From 9e0d2563ee3adc08b27f365e315855d776fd08f0 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 11 七月 2025 10:00:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
pages/tabbar/user/utils/tool.vue | 19
api/members.js | 20
pages/tabbar/index/home.vue | 121 +
uni_modules/uni-table/components/uni-tbody/uni-tbody.vue | 34
pages/video/video-edit.vue | 5
pages/mine/myAttention.vue | 132 +
pages/userPermissions/userPermissions.vue | 2
pages/goods-manager/addGoods/addGoods.vue | 5
pages/mine/myCollect/myCollect.vue | 63
pages/passport/entry/seller/step1.vue | 3
pages/mine/set/personMsg.vue | 79
pages/supplier/suppler-order/order-detail.vue | 471 ++++
uni_modules/uni-table/components/uni-td/uni-td.vue | 95 +
uni_modules/uni-table/components/uni-tr/table-checkbox.vue | 179 +
uni_modules/uni-table/components/uni-th/uni-th.vue | 295 +++
pages/mine/myTracks.vue | 285 ++
pages.json | 36
uni_modules/uni-table/i18n/es.json | 9
uni_modules/uni-table/package.json | 86
api/store.js | 32
pages/mine/msgTips/packageMsg/logisticsDetail.vue | 1
pages/order/myOrder.vue | 33
uni_modules/uni-steps/package.json | 87
pages/tabbar/user/my.vue | 69
pages/tabbar/video/video.vue | 4
components/dropdown-menu.vue | 4
pages/supplier/suppler-order/order-detail - 副本.vue | 69
pages/order/afterSales/afterSalesDetail.vue | 2
api/user.js | 13
uni_modules/uni-table/components/uni-thead/uni-thead.vue | 137 +
pages/video/home-page.vue | 29
pages/order/complain/complain.vue | 2
pages/kitchen/KitchenVideo.vue | 188 +
pages/supplier/suppler-order/suppler-order.vue | 101
pages/supplier/publish-goods/chooseCategery.vue | 66
uni_modules/uni-table/changelog.md | 35
pages/goods-manager/goodsList/goodsList.vue | 2
pages/mine/set/feedBack.vue | 2
uni_modules/uni-table/components/uni-table/uni-table.vue | 460 ++++
App.vue | 8
pages/health/healthVideo.vue | 112 +
pages/product/shopPage.vue | 12
uni_modules/uni-table/components/uni-th/filter-dropdown.vue | 511 +++++
uni_modules/uni-table/i18n/zh-Hant.json | 9
uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue | 4
api/video.js | 14
uni_modules/uni-table/components/uni-tr/uni-tr.vue | 184 +
uni_modules/uni-steps/changelog.md | 18
api/common.js | 3
uni_modules/uni-table/i18n/zh-Hans.json | 9
uni_modules/uni-table/i18n/en.json | 9
api/supplier.js | 69
pages/order/evaluate/releaseEvaluate.vue | 2
uni_modules/uni-steps/readme.md | 13
pages/supplier/publish-goods/goodsInfo.vue | 877 +++++++++
uni_modules/uni-steps/components/uni-steps/uni-steps.vue | 280 ++
uni_modules/uni-table/i18n/fr.json | 9
uni_modules/uni-table/i18n/index.js | 12
pages/passport/entry/seller/step3.vue | 2
pages/video/video-play.vue | 109 +
uni_modules/uni-table/readme.md | 13
pages/commodity-square/commoditySquare.vue | 18
pages/supplier/publish-goods/publishGoods.vue | 85
63 files changed, 5,386 insertions(+), 271 deletions(-)
diff --git a/App.vue b/App.vue
index dd61afb..62fe818 100644
--- a/App.vue
+++ b/App.vue
@@ -254,10 +254,10 @@
/* 鍦ㄧ嚎閾炬帴鏈嶅姟浠呬緵骞冲彴浣撻獙鍜岃皟璇曚娇鐢紝骞冲彴涓嶆壙璇烘湇鍔$殑绋冲畾鎬э紝浼佷笟瀹㈡埛闇�涓嬭浇瀛椾綋鍖呰嚜琛屽彂甯冧娇鐢ㄥ苟鍋氬ソ澶囦唤銆� */
@font-face {
font-family: 'iconfont'; /* Project id 4921691 */
- src:
- url('//at.alicdn.com/t/c/font_4921691_xee9dyc5vvk.woff2?t=1751423177597') format('woff2'),
- url('//at.alicdn.com/t/c/font_4921691_xee9dyc5vvk.woff?t=1751423177597') format('woff'),
- url('//at.alicdn.com/t/c/font_4921691_xee9dyc5vvk.ttf?t=1751423177597') format('truetype');
+ src:
+ url('//at.alicdn.com/t/c/font_4921691_pgrsygpr4.woff2?t=1751620237240') format('woff2'),
+ url('//at.alicdn.com/t/c/font_4921691_pgrsygpr4.woff?t=1751620237240') format('woff'),
+ url('//at.alicdn.com/t/c/font_4921691_pgrsygpr4.ttf?t=1751620237240') format('truetype');
}
.iconfont {
/* font-family闇�瑕佸拰鑷畾涔夌殑鐩稿悓 */
diff --git a/api/common.js b/api/common.js
index 023c24b..0a56d73 100644
--- a/api/common.js
+++ b/api/common.js
@@ -50,4 +50,5 @@
* 鏂囦欢涓婁紶鍦板潃
* @type {string}
*/
-export const upload = api.common + "/common/upload/file";
+export const upload = api.common + "/lmk/file/upload";
+export const multiUpload = api.common + "/lmk/file/multi/upload";
diff --git a/api/members.js b/api/members.js
index e198238..bfff6e4 100644
--- a/api/members.js
+++ b/api/members.js
@@ -387,7 +387,7 @@
}
/**
- * 鎴戠殑瓒宠抗鍒楄〃
+ * 鎴戠殑瓒宠抗鍒楄〃-鍟嗗搧
* @param pageNumber pageSize
*
*/
@@ -401,12 +401,26 @@
}
/**
+ * 鎴戠殑瓒宠抗鍒楄〃-瑙嗛
+ * @param pageNumber pageSize
+ *
+ */
+export function myVideoHistory(params) {
+ return http.request({
+ url: `/lmk/video/history`,
+ method: Method.GET,
+ needToken: true,
+ params,
+ });
+}
+
+/**
* 鏍规嵁id鍒犻櫎浼氬憳瓒宠抗
* @param id
*/
-export function deleteHistoryListId(ids) {
+export function deleteHistoryListId(ids, viewType) {
return http.request({
- url: `/member/footprint/delByIds/${ids}`,
+ url: `/member/footprint/delByIds/${viewType}/${ids}`,
method: Method.DELETE,
needToken: true,
});
diff --git a/api/store.js b/api/store.js
index 61c57b8..6edae68 100644
--- a/api/store.js
+++ b/api/store.js
@@ -67,5 +67,37 @@
});
}
+/**
+ * 鑾峰彇鐗╂祦妯℃澘
+ *
+ */
+ export function getFreightTemplate() {
+ return http.request({
+ url: `/store/store/freightTemplate`,
+ method: Method.GET
+ });
+}
+/**
+ * 鑾峰彇璁¢噺鍗曚綅
+ *
+ */
+ export function getGoodsUnit(param) {
+ return http.request({
+ url: `/store/store/goods/unit`,
+ method: Method.GET,
+ param: param
+ });
+}
+/**
+ * 鍙戝竷鍟嗗搧
+ *
+ */
+ export function createGoods(data) {
+ return http.request({
+ url: `/store/store/goods/create`,
+ method: Method.POST,
+ data: data
+ });
+}
diff --git a/api/supplier.js b/api/supplier.js
new file mode 100644
index 0000000..d0d47a4
--- /dev/null
+++ b/api/supplier.js
@@ -0,0 +1,69 @@
+/**
+ * 灏忕▼搴忓晢鎴风API
+ */
+import { http, Method } from "@/utils/request.js";
+
+import api from "@/config/api.js";
+
+/**
+ * 灏忕▼搴忓晢鎴风鑾峰彇搴楅摵缁忚惀鐨勫垎绫�
+ *
+ * @param params
+ */
+ export function getMyActivityList() {
+ return http.request({
+ url: "/lmk/supplier/allCategery",
+ method: Method.GET,
+ needToken: true,
+ });
+}
+/**
+ * 灏忕▼搴忓晢鎴风鑾峰彇搴楅摵缁忚惀鐨勫垎绫�
+ *
+ * @param params
+ */
+ export function supplierOrderList(param) {
+ return http.request({
+ url: "/lmk/supplier/orderList",
+ method: Method.GET,
+ needToken: true,
+ params:param
+ });
+}
+/**
+ * 鑾峰彇璁㈠崟璇︽儏
+ *
+ * @param params
+ */
+ export function supplierOrderDetail(snNo) {
+ return http.request({
+ url: "/lmk/supplier/orderDetail/"+snNo,
+ method: Method.GET,
+ needToken: true,
+ });
+}
+/**
+ * 鑾峰彇鍟嗗寮�鏀剧殑蹇�掔被鍨�
+ *
+ * @param params
+ */
+ export function getChecked() {
+ return http.request({
+ url: "/lmk/supplier/getChecked",
+ method: Method.GET,
+ needToken: true,
+ });
+}
+/**
+ * 鑾峰彇鍟嗗寮�鏀剧殑蹇�掔被鍨�
+ *
+ * @param params
+ */
+ export function partDelivery(orderSn,data) {
+ return http.request({
+ url: `/lmk/supplier/${orderSn}/partDelivery`,
+ method: Method.POST,
+ needToken: true,
+ data:data
+ });
+}
diff --git a/api/user.js b/api/user.js
index 133f094..4aece02 100644
--- a/api/user.js
+++ b/api/user.js
@@ -77,3 +77,16 @@
});
}
+/**
+ * 鎴戠殑鍏虫敞鍒嗛〉
+ *
+ * @param params
+ */
+ export function mySubscribePage(params) {
+ return http.request({
+ url: "/lmk/my-subscribe/page",
+ method: Method.GET,
+ needToken: true,
+ params: params
+ });
+}
\ No newline at end of file
diff --git a/api/video.js b/api/video.js
index cbe9a13..cb46c25 100644
--- a/api/video.js
+++ b/api/video.js
@@ -36,6 +36,20 @@
}
/**
+ * 鏍规嵁鍟嗗搧鑾峰彇鐩稿叧瑙嗛
+ *
+ * @param params
+ */
+ export async function getGoodsSimilarlyVideos(params) {
+ return http.request({
+ url: "/lmk/video/goods/similarly",
+ method: Method.POST,
+ needToken: true,
+ data: params
+ });
+}
+
+/**
* 鑾峰彇澶у仴搴锋帹鑽愯棰�
*
* @param params
diff --git a/components/dropdown-menu.vue b/components/dropdown-menu.vue
index b9bc7f3..cf305ba 100644
--- a/components/dropdown-menu.vue
+++ b/components/dropdown-menu.vue
@@ -2,9 +2,9 @@
<view class="dropdown-container" :style="{ '--theme-color': themeColor }">
<!-- 瑙﹀彂鎸夐挳 -->
<view class="dropdown-trigger" @click="toggleDropdown">
- <uni-icons type="more-filled" size="20" color="#666"></uni-icons>
+ <uni-icons type="more-filled" size="20" color="#fff"></uni-icons>
<view class="dropdown-icon" :class="{ 'rotate': isOpen }">
- <uni-icons type="arrowdown" size="16" color="#666"></uni-icons>
+ <uni-icons type="arrowdown" size="16" color="#fff"></uni-icons>
</view>
</view>
diff --git a/pages.json b/pages.json
index 3d7fe01..e04b985 100644
--- a/pages.json
+++ b/pages.json
@@ -240,7 +240,7 @@
}
},
{
- "path": "pages/goods-manager/addGoods/addGoods",
+ "path": "pages/supplier/publish-goods/publishGoods",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "鏂板鍟嗗搧",
@@ -365,6 +365,13 @@
"u-loadmore":"view",
"u-switch": "view"
}
+ }
+ },
+ {
+ "path" : "pages/supplier/publish-goods/goodsInfo",
+ "style" :
+ {
+ "navigationBarTitleText" : ""
}
}
],
@@ -874,6 +881,14 @@
"u-loadmore": "view"
}
}
+ },
+ {
+ "path" : "myAttention",
+ "style" :
+ {
+ "navigationBarTitleText" : "鍏虫敞鍒楄〃",
+ "enablePullDownRefresh": true
+ }
}
]
},
@@ -883,8 +898,7 @@
{
"path": "shopPage",
"style": {
- "navigationBarTitleText": "",
- "navigationStyle": "custom"
+ "navigationBarTitleText": ""
}
},
{
@@ -1537,6 +1551,22 @@
"navigationStyle": "custom"
}
}]
+ },
+ {
+ "root": "pages/supplier/suppler-order",
+ "pages": [{
+ "path": "suppler-order",
+ "style": {
+ "navigationBarTitleText": "渚涘簲鍟嗙"
+ // "navigationStyle": "custom"
+ }
+ },{
+ "path": "order-detail",
+ "style": {
+ "navigationBarTitleText": "璁㈠崟璇︽儏"
+ // "navigationStyle": "custom"
+ }
+ }]
}
// ,
// {
diff --git a/pages/commodity-square/commoditySquare.vue b/pages/commodity-square/commoditySquare.vue
index 84733d2..7bbfbd0 100644
--- a/pages/commodity-square/commoditySquare.vue
+++ b/pages/commodity-square/commoditySquare.vue
@@ -21,20 +21,22 @@
<view class="goodsItem" v-for="item in goodsList" :key="item.id"
@click.prevent="goToGoodsInfo(item.id)"
- style="display: flex;align-items: flex-start;justify-content: flex-start;margin: 10rpx 0;">
- <view class="pic">
+ style="display: flex;align-items: flex-start;justify-content: flex-start;margin: 10rpx 0;
+ box-sizing: border-box; ">
+ <view class="pic" style="position: relative;">
<image :src="item.thumbnail" mode="aspectFill"
style="height: 150rpx;width: 150rpx;border-radius: 24rpx;">
</image>
+ <text style="background-color: #f92e20;color: #fff;
+ font-weight: bold;border-radius: 12rpx;padding: 5rpx;
+ margin-right: 15rpx;position: absolute;top: 0;left: 0;" v-if="item.salesModel==='PRESALE'">棰勫敭</text>
</view>
<view class="goodsContent" style="display: flex;align-items: flex-start;justify-content: space-between;
margin-left: 10rpx;flex-direction: column;width: 100%;">
<view class="goodsName">
- <text style="background-color: #f92e20;color: #fff;
- font-weight: bold;border-radius: 12rpx;padding: 5rpx;
- margin-right: 15rpx;">棰勫敭</text>
<text>{{item.goodsName}}</text>
</view>
+
<view
style="display: flex; justify-content: space-between;align-items:center; 100%;margin-top: 32rpx;width: 100%;">
<view class="goodsPrice">锟{item.price}}</view>
@@ -43,7 +45,7 @@
@click.stop="miousCardNum($event,item.id)">
<uni-icons type="minus" size="30" color="#96a6bc"></uni-icons>
</view>
- <input v-show="item.cardNum&&item.cardNum>0" :maxlength="2" type="number"
+ <input v-show="item.cardNum&&item.cardNum>0" @click.stop="" :maxlength="2" type="number"
confirm-type="numeric" style="width: 50rpx;text-align: center;"
v-model="item.cardNum" :disabled="true" />
<view style="padding: 20rpx 20rpx 20rpx 0;"
@@ -106,7 +108,8 @@
pageSize: 12,
pageNumber: 1,
categoryId: null,
- canFilter: true
+ canFilter: true,
+ needFilterPre:true
},
}
},
@@ -283,6 +286,7 @@
}
})
this.goodsList = goodsList.data.result.records;
+ console.log('this.goodsList----------------------->',JSON.stringify(this.goodsList))
},
async chooseCategory(id) {
diff --git a/pages/goods-manager/addGoods/addGoods.vue b/pages/goods-manager/addGoods/addGoods.vue
index 0dfd68a..403106a 100644
--- a/pages/goods-manager/addGoods/addGoods.vue
+++ b/pages/goods-manager/addGoods/addGoods.vue
@@ -77,12 +77,13 @@
<script>
import '@/components/uview-components/uview-ui';
-
+import { upload } from "@/api/common.js";
import storage from "@/utils/storage.js";
import * as API_GOODS from "@/api/goods.js";
export default {
data() {
return {
+ action: upload,
c_index: 0,
b_index: 0,
u_index: 0,
@@ -101,7 +102,7 @@
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.form.images = images;
},
diff --git a/pages/goods-manager/goodsList/goodsList.vue b/pages/goods-manager/goodsList/goodsList.vue
index 9e62ee5..761771f 100644
--- a/pages/goods-manager/goodsList/goodsList.vue
+++ b/pages/goods-manager/goodsList/goodsList.vue
@@ -158,7 +158,7 @@
},
addGoods(id) {
uni.navigateTo({
- url: `/pages/goods-manager/addGoods/addGoods${id ? "?id=" + id : ""}`,
+ url: `/pages/supplier/publish-goods/publishGoods`,
});
}
diff --git a/pages/health/healthVideo.vue b/pages/health/healthVideo.vue
index 369fea2..d565009 100644
--- a/pages/health/healthVideo.vue
+++ b/pages/health/healthVideo.vue
@@ -132,9 +132,9 @@
<!-- 鍙充晶浜掑姩鎸夐挳 -->
<view class="action-buttons" v-if="false">
<view class="avatar-container">
- <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
+ <image class="avatar" @click="jumpToHomePage(item.authorId)" @touchend.stop :src="item.authorAvatar" mode="aspectFill"></image>
<!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
- <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
+ <view v-if="!item.subscribeThisAuthor" class="follow-icon" @touchend.stop @click="subscribeAuth(index, item.authorId)">
<text class="iconfont"></text>
</view>
</view>
@@ -256,7 +256,8 @@
addVideoComment,
thubmsUpComment,
cancelThubmsUpComment,
- changeThumbsUp
+ changeThumbsUp,
+ getGoodsSimilarlyVideos
} from "@/api/video.js";
import { changeCollect } from "@/api/collect.js";
import { saveShare, saveShareClickRecord } from "@/api/share.js";
@@ -340,6 +341,17 @@
pageSize: 10,
videoFrom: 'recommend'
},
+ goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
+ pageNumber: 1,
+ pageSize: 10,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ },
+ similarlyVideoList: [], // 鐩镐技瑙嗛
+ similarlyNomore: false, // 鏄惁杩樻湁鏇村鐩镐技瑙嗛
+ similaryVideoIndex: 0, // 鐩镐技瑙嗛鐨勬挱鏀句綅缃�
+ similarlyLoading: false, // 鐩镐技瑙嗛鍔犺浇
marginBottom: 0 // 搴曢儴瀹夊叏鍖哄煙
}
},
@@ -398,6 +410,35 @@
}
},
methods: {
+ // 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
+ async getGoodsSimilarly() {
+ if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
+ const video = this.videoList[this.currentIndex];
+ if (video.goodsList && video.goodsList.length > 0) {
+ this.goodsSimilarlyQuery.goodsIds = video.goodsList.map(goods => goods.goodsId);
+ this.goodsSimilarlyQuery.currentVideoId = video.id;
+ if (this.similarlyVideoList.length < 1) {
+ this.similarlyVideoList.push(video); // 纭繚鍘熻棰戞槸妯悜瑙嗛鐨勭涓�涓厓绱�
+ }
+ this.similarlyLoading = true;
+ return getGoodsSimilarlyVideos(this.goodsSimilarlyQuery).then(res => {
+
+ this.similarlyVideoList = [
+ ...this.similarlyVideoList,
+ ...res.data.data.filter(
+ (newItem) => !this.similarlyVideoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+
+ this.similarlyLoading = false;
+ if(res.data.data.length < this.goodsSimilarlyQuery.pageSize) {
+ this.similarlyNomore = true;
+ return;
+ }
+ this.goodsSimilarlyQuery.pageNumber++;
+ })
+ }
+ },
topBarChange(titleObj) {
if (titleObj.index === 'home') {
uni.switchTab({
@@ -703,19 +744,25 @@
this.loading = true;
getHealthRecommendVideos(this.videoQuery).then(res => {
- console.log(res, "瑙嗛鏁版嵁");
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
if (this.videoQuery.pageNumber === 1) {
- this.videoList = res.data.data;
+ this.videoList = data;
} else {
this.videoList = [
...this.videoList,
- ...res.data.data.filter(
+ ...data.filter(
(newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
),
];
}
this.loading = false;
- if(res.data.data.length < this.videoQuery.pageSize) {
+ if(data.length < this.videoQuery.pageSize) {
this.videoNoMore = true;
return;
}
@@ -750,6 +797,23 @@
// 鎾斁褰撳墠瑙嗛
const videoContext1 = uni.createVideoContext(`video${this.currentIndex}`, this);
videoContext1.play()
+
+ // 涓嬫粦鏃讹紝闇�瑕佸皢涓婁竴涓棰戦噸缃负鍘熷瑙嗛(濡傛灉妯悜婊戝姩浜嗙浉鍏宠棰�)
+ if (this.similaryVideoIndex !== 0) {
+ this.videoList[oldIndex] = this.similarlyVideoList[0]
+ }
+ this.similarlyVideoList = [];
+ this.similaryVideoIndex = 0;
+ this.similarlyNomore = false;
+ this.similarlyLoading = false;
+ this.goodsSimilarlyQuery = {
+ pageNumber: 1,
+ pageSize: 6,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ }
+
// 濡傛灉鍓╀綑瑙嗛涓嶈冻锛岃Е鍙戣姹傝幏鍙栨洿澶氳棰�
if (this.videoList.length - 1 < this.currentIndex + this.videoLiveOffset) {
this.loadVideos()
@@ -768,7 +832,7 @@
this.touchXY.endY = e.touches[0].pageY
},
// 缁撴潫瑙︽懜
- handleSwiperEnd(item) {
+ async handleSwiperEnd(item) {
// 闃叉婊戝姩婊氬姩鏉′篃瑙﹀彂璺宠浆
if (this.showProcess) {
return
@@ -780,11 +844,37 @@
if (Math.abs(diffX) > Math.abs(diffY)) {
if (diffX > 0) {
console.log('鍙虫粦')
- if (item.goodsList && item.goodsList.length > 0) {
- this.jumpToPay(item.id)
- }
+ if (this.similaryVideoIndex !== 0) {
+ // 濡傛灉婊戝姩浜嗘í鍚戣棰戯紝閭d箞鍙虫粦灏卞仛瑙嗛鍒囨崲鑰屼笉鏄烦杞晢鍝侀〉
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.max(this.similaryVideoIndex - 1, 0);
+ if (this.similaryVideoIndex < oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ // this.videoList[this.currentIndex] = video
+ }
+ }
+ else if (item.goodsList && item.goodsList.length > 0) {
+ this.jumpToPay(item.id)
+ }
} else {
console.log('宸︽粦')
+ if (this.similarlyVideoList.length < 1 || this.similarlyVideoList.length - this.similaryVideoIndex - 1 <= 3) {
+ // 鐩稿叧瑙嗛涓虹┖鎴栬�呭墿浣欒棰戜笉瓒筹紝瑙﹀彂鍔犺浇鐩稿叧瑙嗛
+ await this.getGoodsSimilarly()
+ }
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.min(this.similaryVideoIndex + 1, this.similarlyVideoList.length - 1);
+ if (this.similaryVideoIndex > oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ }
}
}
// 閲嶇疆鍧愭爣
diff --git a/pages/kitchen/KitchenVideo.vue b/pages/kitchen/KitchenVideo.vue
index 8bafd83..84bc77d 100644
--- a/pages/kitchen/KitchenVideo.vue
+++ b/pages/kitchen/KitchenVideo.vue
@@ -1,5 +1,15 @@
<template>
<view class="video-container">
+ <view class="choosePlatType" :style="{top: menueButton + 'px'}">
+ <view class="platTypeItem" v-for="item in choosePlat" :key="item.type" @click="chooseType=item.type">
+ <view class="platTypeItenName">
+ {{item.name}}
+ </view>
+ <view class="platTypeItemChoose" v-if="chooseType===item.type" >
+ </view>
+ </view>
+
+ </view>
<!-- 瑙嗛鍔犺浇 -->
<zero-loading v-show="videoLoading" type="circle" color="#0ebd57" text=""></zero-loading>
<view class="showLeft" @click="showDrawer('showLeft')" v-if="!showLeft" :style="{top: buttonHeight+'px'}">
@@ -135,9 +145,9 @@
<!-- 鍙充晶浜掑姩鎸夐挳 -->
<view class="action-buttons" v-if="false">
<view class="avatar-container">
- <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
+ <image class="avatar" @click="jumpToHomePage(item.authorId)" @touchend.stop :src="item.authorAvatar" mode="aspectFill"></image>
<!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
- <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
+ <view v-if="!item.subscribeThisAuthor" class="follow-icon" @touchend.stop @click="subscribeAuth(index, item.authorId)">
<text class="iconfont"></text>
</view>
</view>
@@ -242,7 +252,7 @@
</view>
</view>
</uni-popup>
- <uni-drawer ref="showLeft" mode="left" width="120" :cus-style="true" height="80vh"
+ <uni-drawer v-if="leftHeight" ref="showLeft" mode="left" width="120" :cus-style="true" :height="`${leftHeight}px`"
@change="change($event,'showLeft')" class="navigationLeft" :drawerTop="buttonHeight">
<scroll-view class="typeNavigation" :scroll-y="true" :show-scrollbar="false">
<view class="typeNavigationItem" :class="{typeNavigationItemCheck:currentCategort ==item.id}"
@@ -267,7 +277,8 @@
addVideoComment,
thubmsUpComment,
cancelThubmsUpComment,
- changeThumbsUp
+ changeThumbsUp,
+ getGoodsSimilarlyVideos
} from "@/api/video.js";
import {
changeCollect
@@ -280,6 +291,13 @@
},
data() {
return {
+ choosePlat:[
+ {type:'platForm',name:'骞冲彴'},
+ {type:'custom',name:'鐢ㄦ埛'}
+ ],
+ chooseType:'platForm',
+ leftHeight:null,
+ menueButton:0,
buttonHeight:0,
showLeft:false,
currentCategort: '',
@@ -354,11 +372,22 @@
videoFrom: 'recommend',
videoType: 'cook'
},
+ goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
+ pageNumber: 1,
+ pageSize: 10,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ },
+ similarlyVideoList: [], // 鐩镐技瑙嗛
+ similarlyNomore: false, // 鏄惁杩樻湁鏇村鐩镐技瑙嗛
+ similaryVideoIndex: 0, // 鐩镐技瑙嗛鐨勬挱鏀句綅缃�
+ similarlyLoading: false, // 鐩镐技瑙嗛鍔犺浇
marginBottom: 0 // 搴曢儴瀹夊叏鍖哄煙
}
},
onShow() {
- this.showDrawer('showLeft')
+ // this.showDrawer('showLeft')
this.loadVideos()
// 濡傛灉瑙嗛鎸変笅鏆傚仠鍚庡垏鎹㈤〉闈㈠啀鍥炲埌椤甸潰鏃讹紝鍙畻鏆傚仠鏃堕棿锛堝洜涓烘殏鍋滄椂闂村拰绂诲紑椤甸潰鏃堕棿鏄噸澶嶇殑锛屽彧绠椾竴涓級
if (this.startHidenTime !== 0 && this.currentVideoIsPlaying) {
@@ -370,14 +399,51 @@
this.startHidenTime = Date.now()
},
onLoad() {
- this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
- // 鑾峰彇鐘舵�佹爮楂樺害
- const systemInfo = uni.getSystemInfoSync();
- this.buttonHeight = systemInfo.statusBarHeight;
+ this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
+ // 鑾峰彇鐘舵�佹爮楂樺害
+ const systemInfo = uni.getSystemInfoSync();
+ console.log('systemInfo------------------------>',systemInfo.windowHeight)
+ const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
+ console.log('menuButtonInfo--------------------------->',menuButtonInfo)
+ const {top,height} = menuButtonInfo
+ this.buttonHeight = systemInfo.statusBarHeight+height;
+ this.menueButton = top;
+ console.log('systemInfo.safeAreaInsets.bottom>',systemInfo.safeAreaInsets.bottom)
+ this.leftHeight = systemInfo.windowHeight - top -50 - systemInfo.safeAreaInsets.bottom -22;
+ console.log('-------------leftHeight------------------------>',this.leftHeight)
this.getKitchenTypeList();
this.loadVideos();
},
methods: {
+ // 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
+ async getGoodsSimilarly() {
+ if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
+ const video = this.videoList[this.currentIndex];
+ if (video.goodsList && video.goodsList.length > 0) {
+ this.goodsSimilarlyQuery.goodsIds = video.goodsList.map(goods => goods.goodsId);
+ this.goodsSimilarlyQuery.currentVideoId = video.id;
+ if (this.similarlyVideoList.length < 1) {
+ this.similarlyVideoList.push(video); // 纭繚鍘熻棰戞槸妯悜瑙嗛鐨勭涓�涓厓绱�
+ }
+ this.similarlyLoading = true;
+ return getGoodsSimilarlyVideos(this.goodsSimilarlyQuery).then(res => {
+
+ this.similarlyVideoList = [
+ ...this.similarlyVideoList,
+ ...res.data.data.filter(
+ (newItem) => !this.similarlyVideoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+
+ this.similarlyLoading = false;
+ if(res.data.data.length < this.goodsSimilarlyQuery.pageSize) {
+ this.similarlyNomore = true;
+ return;
+ }
+ this.goodsSimilarlyQuery.pageNumber++;
+ })
+ }
+ },
async chooseCategory(id) {
if (this.currentCategort === id) return
this.currentCategort = id
@@ -666,19 +732,25 @@
this.loading = true;
getkitchenVideoList(this.videoQuery).then(res => {
- console.log(res, "瑙嗛鏁版嵁");
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
if (this.videoQuery.pageNumber === 1) {
- this.videoList = res.data.data;
+ this.videoList = data;
} else {
this.videoList = [
...this.videoList,
- ...res.data.data.filter(
+ ...data.filter(
(newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
),
];
}
this.loading = false;
- if (res.data.data.length < this.videoQuery.pageSize) {
+ if (data.length < this.videoQuery.pageSize) {
this.videoNoMore = true;
return;
}
@@ -713,6 +785,23 @@
// 鎾斁褰撳墠瑙嗛
const videoContext1 = uni.createVideoContext(`video${this.currentIndex}`, this);
videoContext1.play()
+
+ // 涓嬫粦鏃讹紝闇�瑕佸皢涓婁竴涓棰戦噸缃负鍘熷瑙嗛(濡傛灉妯悜婊戝姩浜嗙浉鍏宠棰�)
+ if (this.similaryVideoIndex !== 0) {
+ this.videoList[oldIndex] = this.similarlyVideoList[0]
+ }
+ this.similarlyVideoList = [];
+ this.similaryVideoIndex = 0;
+ this.similarlyNomore = false;
+ this.similarlyLoading = false;
+ this.goodsSimilarlyQuery = {
+ pageNumber: 1,
+ pageSize: 6,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ }
+
// 濡傛灉鍓╀綑瑙嗛涓嶈冻锛岃Е鍙戣姹傝幏鍙栨洿澶氳棰�
if (this.videoList.length - 1 < this.currentIndex + this.videoLiveOffset) {
this.loadVideos()
@@ -731,7 +820,7 @@
this.touchXY.endY = e.touches[0].pageY
},
// 缁撴潫瑙︽懜
- handleSwiperEnd(item) {
+ async handleSwiperEnd(item) {
// 闃叉婊戝姩婊氬姩鏉′篃瑙﹀彂璺宠浆
if (this.showProcess) {
return
@@ -743,11 +832,37 @@
if (Math.abs(diffX) > Math.abs(diffY)) {
if (diffX > 0) {
console.log('鍙虫粦')
- if (item.goodsList && item.goodsList.length > 0) {
- this.jumpToPay(item.id)
- }
+ if (this.similaryVideoIndex !== 0) {
+ // 濡傛灉婊戝姩浜嗘í鍚戣棰戯紝閭d箞鍙虫粦灏卞仛瑙嗛鍒囨崲鑰屼笉鏄烦杞晢鍝侀〉
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.max(this.similaryVideoIndex - 1, 0);
+ if (this.similaryVideoIndex < oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ // this.videoList[this.currentIndex] = video
+ }
+ }
+ else if (item.goodsList && item.goodsList.length > 0) {
+ this.jumpToPay(item.id)
+ }
} else {
console.log('宸︽粦')
+ if (this.similarlyVideoList.length < 1 || this.similarlyVideoList.length - this.similaryVideoIndex - 1 <= 3) {
+ // 鐩稿叧瑙嗛涓虹┖鎴栬�呭墿浣欒棰戜笉瓒筹紝瑙﹀彂鍔犺浇鐩稿叧瑙嗛
+ await this.getGoodsSimilarly()
+ }
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.min(this.similaryVideoIndex + 1, this.similarlyVideoList.length - 1);
+ if (this.similaryVideoIndex > oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ }
}
}
// 閲嶇疆鍧愭爣
@@ -954,7 +1069,42 @@
::v-deep .custom-tabbar {
border-top: none !important;
}
-
+.choosePlatType{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: fixed;
+ z-index: 9999;
+ left: 0;
+ right: 0;
+
+}
+.platTypeItem{
+ width: 80rpx;
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+ height: 60rpx;
+
+}
+.platTypeItem:nth-child(n+1){
+ margin-left: 32rpx;
+}
+.platTypeItemChoose{
+ margin-top: 15rpx;
+ width: 40%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #fff;
+ height: 4rpx;
+ border-radius: 5rpx;
+}
+.platTypeItenName{
+ color: #fff;
+ font-weight: bold;
+ font-size: 32rpx;
+}
.video-container {
position: relative;
width: 100%;
@@ -970,7 +1120,7 @@
background-color: #b6b6b6;
opacity: 0.8;
position: fixed;
- z-index: 999;
+ z-index: 99999;
height: 70rpx;
width: 50rpx;
border-radius: 0 50% 50% 0;
diff --git a/pages/mine/msgTips/packageMsg/logisticsDetail.vue b/pages/mine/msgTips/packageMsg/logisticsDetail.vue
index 6cf936b..6a573c9 100644
--- a/pages/mine/msgTips/packageMsg/logisticsDetail.vue
+++ b/pages/mine/msgTips/packageMsg/logisticsDetail.vue
@@ -48,6 +48,7 @@
init(sn) {
getExpress(sn).then((res) => {
this.logiList = res.data.result;
+ console.log('-------------------------->loiList',JSON.stringify(this.logiList))
});
},
},
diff --git a/pages/mine/myAttention.vue b/pages/mine/myAttention.vue
new file mode 100644
index 0000000..fdf1518
--- /dev/null
+++ b/pages/mine/myAttention.vue
@@ -0,0 +1,132 @@
+<template>
+ <view class="container">
+
+ <view class="user-list">
+ <view class="user-item" v-for="(user, index) in followList" :key="user.id">
+ <image class="avatar" :src="user.subscribeUserAvatar" @click="jumpToHome(user.subscribeUserId)" mode="aspectFill"></image>
+ <text class="nickname">{{user.subscribeUserNickname}}</text>
+ <button class="unfollow-btn" @click="handleUnfollow(user.subscribeUserId)">鍙栨秷鍏虫敞</button>
+ </view>
+
+ <view v-if="followList.length === 0" class="empty-tip">
+ <text>鎮ㄨ繕娌℃湁鍏虫敞浠讳綍鐢ㄦ埛</text>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ import {mySubscribePage} from "@/api/user.js"
+ import {unSubscribe} from "@/api/video.js"
+export default {
+ data() {
+ return {
+ followList: [],
+ query: {
+ pageNumber: 1,
+ pageSize: 10
+ }
+ }
+ },
+ onPullDownRefresh() {
+ this.query.pageNumber = 1
+ this.getFollowList()
+ },
+ onLoad() {
+ // 椤甸潰鍔犺浇鏃惰幏鍙栧叧娉ㄥ垪琛�
+ this.getFollowList();
+ },
+ methods: {
+ // 鑾峰彇鍏虫敞鍒楄〃
+ getFollowList() {
+ mySubscribePage(this.query).then(res => {
+ this.followList = res.data.data
+ })
+ },
+ // 鍙栨秷鍏虫敞
+ handleUnfollow(userId) {
+ unSubscribe(userId).then(res => {
+ this.getFollowList()
+ })
+ },
+ // 璺宠浆TA鐨勪富椤�
+ jumpToHome(authorId) {
+ uni.navigateTo({
+ url: `/pages/video/home-page?authorId=${authorId}`
+ })
+ }
+ }
+}
+</script>
+
+<style lang="scss">
+.container {
+ padding: 20rpx;
+ background-color: #f7f7f7;
+ min-height: 100vh;
+}
+
+.header {
+ padding: 30rpx 0;
+ text-align: center;
+
+ .title {
+ font-size: 36rpx;
+ font-weight: bold;
+ color: #333;
+ }
+}
+
+.user-list {
+ background-color: #fff;
+ border-radius: 12rpx;
+ overflow: hidden;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+
+ .user-item {
+ display: flex;
+ align-items: center;
+ padding: 20rpx 30rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ &:last-child {
+ border-bottom: none;
+ }
+ }
+
+ .avatar {
+ width: 80rpx;
+ height: 80rpx;
+ border-radius: 50%;
+ margin-right: 20rpx;
+ }
+
+ .nickname {
+ flex: 1;
+ font-size: 32rpx;
+ color: #333;
+ }
+
+ .unfollow-btn {
+ margin: 0;
+ padding: 0 20rpx;
+ height: 60rpx;
+ line-height: 60rpx;
+ font-size: 26rpx;
+ color: #666;
+ background-color: #f5f5f5;
+ border-radius: 30rpx;
+
+ &::after {
+ border: none;
+ }
+ }
+
+ .empty-tip {
+ padding: 40rpx 0;
+ text-align: center;
+ font-size: 28rpx;
+ color: #999;
+ }
+}
+</style>
\ No newline at end of file
diff --git a/pages/mine/myCollect/myCollect.vue b/pages/mine/myCollect/myCollect.vue
index 1349aa0..f6217f8 100644
--- a/pages/mine/myCollect/myCollect.vue
+++ b/pages/mine/myCollect/myCollect.vue
@@ -15,9 +15,9 @@
<scroll-view scroll-y class="activity-list" style="height: 100vh;" @scrolltolower="loadMore"
:lower-threshold="100">
<view v-if="videoCollects.length > 0">
- <view v-for="(item, idx) in videoCollects" :key="idx" class="video-item">
+ <view v-for="(item, idx) in videoCollects" :key="item.id" class="video-item">
<!-- 瑙嗛灏侀潰+鎾斁鎸夐挳 -->
- <view class="video-cover-container">
+ <view class="video-cover-container" @click="jumpToPlay(idx)">
<image :src="item.coverUrl" mode="aspectFill" class="video-cover" />
<view class="play-icon">
<u-icon name="play-circle-fill" size="60" color="#fff"></u-icon>
@@ -26,7 +26,7 @@
</view>
<!-- 瑙嗛淇℃伅 -->
- <view class="video-info">
+ <view class="video-info" @click="jumpToPlay(idx)">
<view class="video-title">{{ item.authorName || '鏈煡浣滆��' }}</view>
<view class="video-meta">
<text class="video-weight" v-if="item.weight > 0">
@@ -38,7 +38,7 @@
<!-- 鎿嶄綔鎸夐挳 -->
<view class="video-actions">
- <button class="cancel-btn" @click.stop="handleCancelCollection(item,'video')">
+ <button class="cancel-btn" @click.stop="handleCancelCollection(item,'video',idx)">
鍙栨秷鏀惰棌
</button>
</view>
@@ -65,7 +65,7 @@
<scroll-view scroll-y class="activity-list" style="height: 100vh;" @scrolltolower="loadMore"
:lower-threshold="100">
<view v-if="goodsCollects.length > 0">
- <view v-for="(item, idx) in goodsCollects" :key="idx" class="activity-item">
+ <view v-for="(item, idx) in goodsCollects" :key="item.id" class="activity-item">
<!-- 灏侀潰鍖哄煙 -->
<block>
<image :src="item.original" mode="aspectFill" class="activity-cover" />
@@ -82,7 +82,7 @@
<!-- 鎿嶄綔鍖哄煙 -->
<view class="action-container">
- <button class="cancel-btn" @click="handleCancelCollection(item,'goods')"
+ <button class="cancel-btn" @click="handleCancelCollection(item,'goods',idx)"
hover-class="cancel-btn-hover">
鍙栨秷鏀惰棌
</button>
@@ -109,7 +109,7 @@
<scroll-view scroll-y class="activity-list" style="height: 80vh;" @scrolltolower="loadMore"
:lower-threshold="100">
<view v-if="activityCollects.length > 0">
- <view v-for="(item, idx) in activityCollects" :key="idx" class="activity-item">
+ <view v-for="(item, idx) in activityCollects" :key="item.id" class="activity-item">
<!-- 灏侀潰鍖哄煙 -->
<block v-if="item.coverType === '鍥剧墖' || item.coverType === '瑙嗛'">
<image :src="item.cover" mode="aspectFill" class="activity-cover" />
@@ -128,7 +128,7 @@
</view>
<!-- 鎿嶄綔鍖哄煙 -->
<view class="action-container">
- <button class="cancel-btn" @click="handleCancelCollection(item,'activity')"
+ <button class="cancel-btn" @click="handleCancelCollection(item,'activity', idx)"
hover-class="cancel-btn-hover">
鍙栨秷鏀惰棌
</button>
@@ -165,6 +165,8 @@
<script>
import '@/components/uview-components/uview-ui';
+ import storage from '@/utils/storage';
+ import {getAuthorCollectVideoPage} from '@/api/user.js'
import {
getFilePreviewUrl
} from '@/api/common.js'
@@ -181,11 +183,7 @@
return {
total: 0,
loading: false,
- noMore: {
- video: false,
- goods: false,
- activity: false
- },
+ noMore: false,
currentTab: 0, // 褰撳墠閫変腑鐨則ab绱㈠紩
tabs: ['瑙嗛', '鍟嗗搧', '娲诲姩'],
//
@@ -197,6 +195,7 @@
refId: '',
},
query: {
+ authorId: '',
type: 'video',
pageNumber: 1,
pageSize: 5,
@@ -205,11 +204,22 @@
},
onLoad() {
this.currentTab = 0;
- //TODO 鏈櫥褰曢渶瑕乮d锛屾祴璇曠敤鍐欐\
+ this.query.authorId = storage.getUserInfo().id
this.getintit()
},
methods: {
-
+ jumpToPlay(index) {
+ const playInfo = {
+ videoList: this.videoCollects,
+ nomore: this.noMore,
+ pageNumber: this.query.pageNumber,
+ playIndex: index
+ }
+ uni.setStorageSync("playInfo", playInfo)
+ uni.navigateTo({
+ url: `/pages/video/video-play?authorId=${this.query.authorId}&videoFrom=collect`
+ });
+ },
/**
* 涓嬫媺鍒锋柊鏃�
*/
@@ -224,25 +234,31 @@
},
loadMore() {
this.loading = true;
- this.query.pageNumber += 1;
// 寤惰繜鎵ц璁︰I鏈夊弽搴旀椂闂�
setTimeout(() => {
this.query.pageNumber += 1;
this.getintit();
}, 300);
},
- handleCancelCollection(item, type) {
+ handleCancelCollection(item, type, index) {
console.log(item)
this.collectForm.collectType = type;
this.collectForm.refId = item.id;
changeCollect(this.collectForm).then(res => {
- if (res.statusCode === 200) {
+ if (res.data.code === 200) {
uni.showToast({
title: res.data.msg, // 鎻愮ず鏂囧瓧
icon: 'none', // 鍥炬爣绫诲瀷锛坰uccess/loading/none锛�
mask: true // 鏄惁鏄剧ず閫忔槑钂欏眰锛堥槻姝㈣Е鎽哥┛閫忥級
});
- this.getintit();
+ this.query.pageNumber = 1
+ // 鍥犱负瑙嗛璧扮殑mq鏈夊欢杩燂紝鍓嶇鐩存帴鍒犻櫎璇ュ厓绱犺揪鍒版晥鏋�
+ if (type === 'video') {
+ this.videoCollects.splice(index, 1)
+ } else {
+ this.noMore = false
+ this.getintit()
+ }
}
})
@@ -272,11 +288,11 @@
});
if (this.currentTab === 0) {
this.query.type = 'video';
- getMyCollectList(this.query).then(res => {
+ getAuthorCollectVideoPage(this.query).then(res => {
uni.hideLoading();
this.loading = false;
- if (res.statusCode === 200) {
+ if (res.data.code === 200) {
const newData = res.data.data
this.total = res.data.total || 0;
// 杩藉姞鎴栨浛鎹㈡暟鎹�
@@ -286,7 +302,6 @@
// 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁
this.noMore = newData.length < this.query.pageSize ||
this.videoCollects.length >= this.total;
-
}
})
} else if (this.currentTab === 1) {
@@ -294,7 +309,7 @@
getMyCollectList(this.query).then(res => {
uni.hideLoading();
this.loading = false;
- if (res.statusCode === 200) {
+ if (res.data.code === 200) {
const newData = res.data.data
this.total = res.data.total || 0;
@@ -311,7 +326,7 @@
getMyCollectList(this.query).then(res => {
uni.hideLoading();
this.loading = false;
- if (res.statusCode === 200) {
+ if (res.data.code === 200) {
const newData = res.data.data
this.total = res.data.total || 0;
diff --git a/pages/mine/myTracks.vue b/pages/mine/myTracks.vue
index bd72c63..7f6a935 100644
--- a/pages/mine/myTracks.vue
+++ b/pages/mine/myTracks.vue
@@ -2,12 +2,61 @@
<view class="myTracks">
<u-navbar title="鎴戠殑瓒宠抗">
<div slot="right">
- <div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '缂栬緫' : '瀹屾垚'}}</div>
- </div>
+ <div class="light-color edit" @click="isEdit = !isEdit">{{ !isEdit ? '缂栬緫' : '瀹屾垚'}}</div>
+ </div>
</u-navbar>
<u-notice-bar mode="vertical" :list="['鍙冲垝鍒犻櫎娴忚璁板綍']"></u-notice-bar>
- <u-empty text="鏆傛棤鍘嗗彶璁板綍" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
- <div v-else>
+ <!-- 椤堕儴閫夐」鍗� -->
+ <view class="tabs">
+ <view
+ class="tab-item"
+ :class="{active: activeTab === 'video'}"
+ @click="switchTab('video')"
+ >
+ 瑙嗛
+ </view>
+ <view
+ class="tab-item"
+ :class="{active: activeTab === 'goods'}"
+ @click="switchTab('goods')"
+ >
+ 鍟嗗搧
+ </view>
+ </view>
+
+ <!-- 瑙嗛娴忚璁板綍鍒楄〃 -->
+ <view v-if="activeTab === 'video'" class="video-list">
+ <view
+ v-for="(item, index) in videoHistory"
+ :key="index"
+ class="video-item"
+ @click="goToVideoPlay(item, index)"
+ >
+ <u-swipe-action style="width: 100%;" :show="item.show" :index="index" :key="item.id"
+ @click="deleteVideoView(item.id)" @open="open" :options="options">
+ <view style="display: flex;" @click="goToVideoPlay(item, index)">
+ <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image>
+ <view class="video-info">
+ <view class="video-title">{{item.title}}</view>
+ <view class="video-author">{{item.authorName}}</view>
+ <view class="video-meta">
+ <text>鎾斁鑷�: {{formatPlayTime(item.playAt)}}</text>
+ <text class="separator">|</text>
+ <text>{{formatDate(item.playTime)}}</text>
+ </view>
+ </view>
+ </view>
+
+ </u-swipe-action>
+ </view>
+ <div @click="deleteVideoView(item.id)" v-if="isEdit" class="submit">
+ 鍒犻櫎鎵�閫�
+ </div>
+ <view v-if="videoHistory.length === 0" class="empty-tip">
+ 鏆傛棤瑙嗛娴忚璁板綍
+ </view>
+ </view>
+ <view v-else-if="activeTab === 'goods'">
<view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navigateToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items">
@@ -37,12 +86,15 @@
</view>
<view class="myTracks-divider"></view>
-
+ <div @click="handleClickDeleteSelected(item.id)" v-if="isEdit" class="submit">
+ 鍒犻櫎鎵�閫�
+ </div>
</view>
- <div @click="handleClickDeleteSelected" v-if="isEdit" class="submit">
- 鍒犻櫎鎵�閫�
- </div>
- </div>
+
+ <view v-if="trackList.length === 0" class="empty-tip">
+ 鏆傛棤鍟嗗搧娴忚璁板綍
+ </view>
+ </view>
</view>
</template>
@@ -52,12 +104,16 @@
import {
myTrackList,
- deleteHistoryListId
+ deleteHistoryListId,
+ myVideoHistory
} from "@/api/members.js";
+import storage from '@/utils/storage';
export default {
data() {
return {
+ activeTab: 'video', // 褰撳墠婵�娲荤殑tab
+ videoHistory: [], // 瑙嗛娴忚鍒楄〃
isEdit:false,
whetherEmpty: false, //鏄惁鏁版嵁涓虹┖
params: {
@@ -73,7 +129,7 @@
backgroundColor: '#dd524d'
}
}],
- trackList: [], //瓒宠抗鍒楄〃
+ trackList: [], //鍟嗗搧娴忚鍒楄〃
};
},
@@ -94,8 +150,75 @@
this.getList();
},
methods: {
+ // 鍒囨崲tab
+ switchTab(tab) {
+ this.activeTab = tab
+ },
+
+ // 璺宠浆鍒拌棰戣鎯呴〉
+ goToVideoPlay(item, index) {
+ const playInfo = {
+ videoList: this.videoHistory,
+ nomore: true,
+ pageNumber: this.params.pageNumber,
+ playIndex: index
+ }
+ uni.setStorageSync("playInfo", playInfo)
+ uni.navigateTo({
+ url: `/pages/video/video-play?authorId=${storage.getUserInfo().id}&videoFrom=history`
+ })
+ },
+
+ // 鏍煎紡鍖栨挱鏀炬椂闂� (绉� -> 鍒�:绉�)
+ formatPlayTime(seconds) {
+ const secsInt = Math.floor(seconds); // 鍘绘帀灏忔暟閮ㄥ垎
+ const mins = Math.floor(secsInt / 60)
+ const secs = secsInt % 60
+ return `${mins}:${secs < 10 ? '0' + secs : secs}`
+ },
+
+ // 鏍煎紡鍖栨棩鏈�
+ formatDate(timestamp) {
+ const now = new Date()
+ const date = new Date(timestamp)
+
+ // 濡傛灉鏄粖澶�
+ if (date.toDateString() === now.toDateString()) {
+ const hours = date.getHours().toString().padStart(2, '0')
+ const minutes = date.getMinutes().toString().padStart(2, '0')
+ return `${hours}:${minutes}`
+ }
+
+ // 濡傛灉鏄槰澶�
+ const yesterday = new Date(now)
+ yesterday.setDate(now.getDate() - 1)
+ if (date.toDateString() === yesterday.toDateString()) {
+ return '鏄ㄥぉ'
+ }
+
+ // 鍏朵粬鎯呭喌鏄剧ず鏃ユ湡
+ const month = date.getMonth() + 1
+ const day = date.getDate()
+ return `${month}鏈�${day}鏃
+ },
checkboxChangeDP(val){
console.log(val)
+ },
+ // 鍒犻櫎瑙嗛娴忚璁板綍
+ deleteVideoView(id) {
+ deleteHistoryListId([id], 'video').then((res) => {
+ if (res.data.code == 200) {
+ this.videoHistory = [];
+ this.params.pageNumber = 1
+ this.getList();
+ } else {
+ uni.showToast({
+ title: res.data.message,
+ duration: 2000,
+ icon: "none",
+ });
+ }
+ });
},
// 鍒犻櫎鎵�閫夌殑鏁版嵁
handleClickDeleteSelected(val){
@@ -141,32 +264,53 @@
uni.showLoading({
title: "鍔犺浇涓�",
});
- myTrackList(this.params).then((res) => {
- uni.stopPullDownRefresh();
- uni.hideLoading();
- if (res.statusCode == 200) {
- res.data.result.records.length &&
- res.data.result.records.forEach((item) => {
+ if (this.activeTab === 'goods') {
+ myTrackList(this.params).then((res) => {
+ uni.stopPullDownRefresh();
+ uni.hideLoading();
+ if (res.statusCode == 200) {
+ res.data.result.records.length &&
+ res.data.result.records.forEach((item) => {
+ item.show = false;
+ item.checked = false
+ });
+
+ let data = res.data.result.records;
+ if (data.total == 0) {
+ this.whetherEmpty = true;
+ } else {
+ this.trackList.push(...data);
+ }
+ }
+ });
+ } else if (this.activeTab === 'video') {
+ myVideoHistory(this.params).then(res => {
+ res.data.data.length &&
+ res.data.data.forEach((item) => {
item.show = false;
item.checked = false
});
-
- let data = res.data.result.records;
+
+ let data = res.data.data;
if (data.total == 0) {
this.whetherEmpty = true;
} else {
- this.trackList.push(...data);
+ this.videoHistory = [
+ ...this.videoHistory,
+ ...res.data.data.filter(
+ (newItem) => !this.videoHistory.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
}
- }
- });
+ })
+ }
+
},
-
-
/**
* 鍒犻櫎瓒宠抗
*/
delTracks(index,ids) {
- deleteHistoryListId(ids || this.trackList[index].goodsId).then((res) => {
+ deleteHistoryListId(ids || this.trackList[index].goodsId, 'goods').then((res) => {
if (res.data.code == 200) {
this.trackList = [];
this.params.pageNumber = 1
@@ -303,4 +447,95 @@
.edit{
padding-right: 32rpx;
}
+ .container {
+ padding: 20rpx;
+ }
+
+ /* 閫夐」鍗℃牱寮� */
+ .tabs {
+ display: flex;
+ margin-bottom: 20rpx;
+ border-bottom: 1rpx solid #eee;
+ }
+
+ .tab-item {
+ flex: 1;
+ text-align: center;
+ padding: 20rpx 0;
+ font-size: 32rpx;
+ color: #666;
+ }
+
+ .tab-item.active {
+ color: #007AFF;
+ position: relative;
+ }
+
+ .tab-item.active::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 50%;
+ transform: translateX(-50%);
+ width: 80rpx;
+ height: 4rpx;
+ background-color: #007AFF;
+ }
+
+ /* 瑙嗛鍒楄〃鏍峰紡 */
+ .video-list {
+ padding: 10rpx 0;
+ }
+
+ .video-item {
+ display: flex;
+ padding-bottom: 10rpx;
+ padding-left: 20rpx;
+ border-bottom: 1rpx solid #f5f5f5;
+ }
+
+ .video-cover {
+ width: 220rpx;
+ height: 160rpx;
+ border-radius: 8rpx;
+ margin-right: 20rpx;
+ }
+
+ .video-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ }
+
+ .video-title {
+ font-size: 30rpx;
+ color: #333;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ line-height: 1.4;
+ }
+
+ .video-author {
+ font-size: 26rpx;
+ color: #999;
+ }
+
+ .video-meta {
+ font-size: 24rpx;
+ color: #999;
+ }
+
+ .separator {
+ margin: 0 10rpx;
+ }
+
+ .empty-tip {
+ text-align: center;
+ padding: 100rpx 0;
+ color: #999;
+ font-size: 28rpx;
+ }
</style>
diff --git a/pages/mine/set/feedBack.vue b/pages/mine/set/feedBack.vue
index fc4a67a..94a2915 100644
--- a/pages/mine/set/feedBack.vue
+++ b/pages/mine/set/feedBack.vue
@@ -67,7 +67,7 @@
onUploaded(lists) {
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.feedBack.images = images.join(",");
},
diff --git a/pages/mine/set/personMsg.vue b/pages/mine/set/personMsg.vue
index aa80980..9441176 100644
--- a/pages/mine/set/personMsg.vue
+++ b/pages/mine/set/personMsg.vue
@@ -1,7 +1,8 @@
<template>
<view class="person-msg">
<view class="head c-content" @click="changeFace">
- <image :src="form.face || '/static/missing-face.png'" mode=""></image>
+ <image v-if="form.face" :src="endpoint + '/' + form.face" mode=""></image>
+ <image v-else :src="'/static/missing-face.png'" mode=""></image>
<view>鐐瑰嚮淇敼澶村儚</view>
</view>
<u-form :model="form" ref="uForm" class="form">
@@ -42,20 +43,25 @@
</template>
<script>
import '@/components/uview-components/uview-ui';
-
+import { getSTSToken } from "@/api/common.js";
import { saveUserInfo, getUserInfo } from "@/api/members.js";
import { upload } from "@/api/common.js";
+import { getFileKey } from "@/utils/file.js";
import storage from "@/utils/storage.js";
import city from "@/components/m-city/m-city.vue";
export default {
components: { "m-city": city },
data() {
return {
+ cosClient: null,
+ bucket: '',
+ region: '',
+ endpoint: '',
lightColor: this.$lightColor, //楂樹寒棰滆壊
form: {
nickName: storage.getUserInfo().nickName || "",
birthday: storage.getUserInfo().birthday || "",
- face: storage.getUserInfo().face || "/static/missing-face.png", //榛樿澶村儚
+ face: storage.getUserInfo().face, //榛樿澶村儚
regionId: [], //鍦板潃Id
region: storage.getUserInfo().region || [], //鍦板潃
sex: storage.getUserInfo().sex, //鎬у埆
@@ -79,7 +85,31 @@
showBirthday: false, //鏄剧ず鐢熸棩鏃ユ湡
};
},
+ onLoad() {
+ this.initCOS()
+ },
methods: {
+ // 鍒濆鍖栬吘璁簯cos瀹㈡埛绔�
+ initCOS() {
+ // 璋冪敤鍚庣鑾峰彇sts涓存椂璁块棶鍑瘉
+ getSTSToken().then(res => {
+ const COS = require('@/lib/cos-wx-sdk-v5.js'); // 寮�鍙戞椂浣跨敤
+ // const COS = require('./lib/cos-wx-sdk-v5.min.js'); // 涓婄嚎鏃朵娇鐢ㄥ帇缂╁寘
+
+ // console.log(COS.version); sdk 鐗堟湰闇�瑕佷笉浣庝簬 1.7.2
+ this.cosClient = new COS({
+ SecretId: res.data.data.tmpSecretId, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� secretId
+ SecretKey: res.data.data.tmpSecretKey, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� secretKey
+ SecurityToken: res.data.data.sessionToken, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� SessionToken
+ StartTime: res.data.data.stsStartTime, // 寤鸿浼犲叆鏈嶅姟绔椂闂达紝鍙伩鍏嶅鎴风鏃堕棿涓嶅噯瀵艰嚧鐨勭鍚嶉敊璇�
+ ExpiredTime: res.data.data.stsEndTime, // 涓存椂瀵嗛挜杩囨湡鏃堕棿
+ SimpleUploadMethod: 'putObject', // 寮虹儓寤鸿锛岄珮绾т笂浼犮�佹壒閲忎笂浼犲唴閮ㄥ灏忔枃浠跺仛绠�鍗曚笂浼犳椂浣跨敤 putObject,sdk 鐗堟湰鑷冲皯闇�瑕乿1.3.0
+ });
+ this.bucket = res.data.data.bucket
+ this.region = res.data.data.region
+ this.endpoint = res.data.data.endpoint
+ })
+ },
/**
* 閫�鍑虹櫥褰�
*/
@@ -135,21 +165,30 @@
*/
changeFace(index) {
uni.chooseImage({
+ count: 1,
+ sizeType: ['compressed'],
+ sourceType: ['album'],
success: (chooseImageRes) => {
- const tempFilePaths = chooseImageRes.tempFilePaths;
- uni.uploadFile({
- url: upload,
- filePath: tempFilePaths[0],
- name: "file",
- header: {
- accessToken: storage.getAccessToken(),
- },
- success: (uploadFileRes) => {
- let data = JSON.parse(uploadFileRes.data);
-
- this.form.face = data.result;
- },
- });
+ const tempFilePath = chooseImageRes.tempFilePaths[0];
+ let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
+ // 澶勭悊瀹夊崜鍙兘鐨刄RI缂栫爜
+ if(fileName.indexOf('%') > -1) {
+ fileName = decodeURIComponent(fileName);
+ }
+ const fileKey = getFileKey(fileName);
+ this.cosClient.uploadFile({
+ Bucket: this.bucket,
+ Region: this.region,
+ Key: fileKey,
+ FilePath: tempFilePath,
+ SliceSize: 1024 * 1024 * 5 /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
+ }, (err, data) => {
+ if (err) {
+ console.log('涓婁紶澶辫触', err);
+ } else {
+ this.form.face = fileKey;
+ }
+ });
},
});
},
@@ -178,12 +217,8 @@
url: '/pages/mine/set/securityCenter/bindMobile' + '?username=' + username,
});
},
- },
+ }
- /**
- * 鍔犺浇鏁版嵁
- */
- onLoad() {},
};
</script>
<style>
diff --git a/pages/order/afterSales/afterSalesDetail.vue b/pages/order/afterSales/afterSalesDetail.vue
index be2efa9..f839e2b 100644
--- a/pages/order/afterSales/afterSalesDetail.vue
+++ b/pages/order/afterSales/afterSalesDetail.vue
@@ -269,7 +269,7 @@
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.form.images = images;
},
diff --git a/pages/order/complain/complain.vue b/pages/order/complain/complain.vue
index 06ed4b8..9023226 100644
--- a/pages/order/complain/complain.vue
+++ b/pages/order/complain/complain.vue
@@ -103,7 +103,7 @@
onUploaded(lists) {
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.images = images;
},
diff --git a/pages/order/evaluate/releaseEvaluate.vue b/pages/order/evaluate/releaseEvaluate.vue
index c2a9cd0..cdb6d8c 100644
--- a/pages/order/evaluate/releaseEvaluate.vue
+++ b/pages/order/evaluate/releaseEvaluate.vue
@@ -160,7 +160,7 @@
onUploaded(lists) {
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.form.images = images;
},
diff --git a/pages/order/myOrder.vue b/pages/order/myOrder.vue
index 758797e..e808a50 100644
--- a/pages/order/myOrder.vue
+++ b/pages/order/myOrder.vue
@@ -143,8 +143,18 @@
>
閫�娆�/鍞悗
</view>
+ <view
+ ripple
+ shape="circle"
+ class="cancel-btn"
+ size="mini"
+ v-if="order.orderStatus === 'COMPLETED' "
+ @click="buyBack(order)"
+ >
+ 鍐嶆潵涓�鍗�
+ </view>
<!-- TODO 鍚庣画瀹屽杽 -->
- <!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
+<!-- <u-button ripple shape="circle" class="rebuy-btn" size="mini" v-if="
order.orderStatus === 'CANCELLED' ||
order.orderStatus === 'COMPLETE'
" @click="reBuy(order)">
@@ -217,6 +227,7 @@
import { getOrderXcxList, cancelOrder, confirmReceipt } from "@/api/order.js";
import { getClearReason } from "@/api/after-sale.js";
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
+import {buyBack} from "@/api/trade.js";
export default {
data() {
@@ -362,6 +373,26 @@
},
},
methods: {
+ //鍐嶆潵涓�鍗�
+ buyBack(order){
+ console.log(JSON.stringify(order))
+ const param = order.orderItems.map(item => {
+ return {
+ skuId: item.skuId,
+ num: item.num
+ }
+ })
+ console.log('------------------>',JSON.stringify(param))
+ buyBack(param).then(res=>{
+ console.log('------------------->',res)
+ if(res.data.code==200){
+ uni.navigateTo({
+ url: "/pages/order/fillorder?way=CART"
+ })
+ }
+ })
+
+ },
// 鍞悗
applyService(order) {
uni.navigateTo({
diff --git a/pages/passport/entry/seller/step1.vue b/pages/passport/entry/seller/step1.vue
index e2a0d73..09bb81e 100644
--- a/pages/passport/entry/seller/step1.vue
+++ b/pages/passport/entry/seller/step1.vue
@@ -315,9 +315,10 @@
methods: {
// 鍥剧墖涓婁紶
onUploaded(lists, key) {
+ console.log("涓婁紶缁撴灉",lists);
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.form[key] = images;
},
diff --git a/pages/passport/entry/seller/step3.vue b/pages/passport/entry/seller/step3.vue
index fcbf32a..33c78ec 100644
--- a/pages/passport/entry/seller/step3.vue
+++ b/pages/passport/entry/seller/step3.vue
@@ -288,7 +288,7 @@
onUploaded(lists, key) {
let images = [];
lists.forEach((item) => {
- images.push(item.response.result);
+ images.push(item.response.data.fileKey);
});
this.form[key] = images;
},
diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue
index 9269be2..f7774bc 100644
--- a/pages/product/shopPage.vue
+++ b/pages/product/shopPage.vue
@@ -81,29 +81,29 @@
</scroll-view>
<!-- 鍩虹搴楅摵妯″紡 -->
- <div v-if="basePageData">
+<!-- <div v-if="basePageData">
<u-tabs :list="tabs" :active-color="mainColor" :is-scroll="false" :current="current" @change="changeTab"></u-tabs>
<div class="content" v-if="current == 0">
<u-empty style='margin-top:100rpx' v-if="goodsList.length == 0" class="empty" text='鏆傛棤鍟嗗搧淇℃伅'></u-empty>
<goodsTemplate style="width:100%;" v-else :res="goodsList" :storeName="false" />
- </div>
+ </div> -->
<!-- 鍏ㄩ儴鍒嗙被 -->
- <div class="category" v-if="current == 1">
+<!-- <div class="category" v-if="current == 1">
<div class="category-item" v-for="(item,index) in categoryList" :key="index">
<div class="flex" @click="getCategoryGoodsList(item)">
<div>{{item.labelName}}</div>
<div>
<u-icon color="#999" name="arrow-right"></u-icon>
</div>
- </div>
+ </div> -->
<!-- 鍒嗙被瀛愮骇 -->
- <div class="child-list" v-if="item.children && item.children.length!=0">
+<!-- <div class="child-list" v-if="item.children && item.children.length!=0">
<div class="child" @click="getCategoryGoodsList(child)" :key='i' v-for="(child,i) in item.children">{{child.labelName}}
</div>
</div>
</div>
</div>
- </div>
+ </div> -->
<!-- 妤煎眰瑁呬慨妯″紡 -->
<div v-if="enablePageData">
diff --git a/pages/supplier/publish-goods/chooseCategery.vue b/pages/supplier/publish-goods/chooseCategery.vue
new file mode 100644
index 0000000..c32acea
--- /dev/null
+++ b/pages/supplier/publish-goods/chooseCategery.vue
@@ -0,0 +1,66 @@
+<template>
+ <view class="container">
+ <scroll-view scroll-y="true" style="height: 70vh">
+ <view class="categeryContainer">
+ <view class="categeryItem" v-for="item in categeryList" :key="item.id" @click="chooseCategery(item.id,item.name)">
+ <view class="cateGeryName" :class="{chooseCategeryStyle:chooseCategeryId==item.id}">
+ {{item.name}}
+ </view>
+ </view>
+ </view>
+ </scroll-view>
+ <view class="">鎮ㄥ綋鍓嶉�夋嫨鐨勫晢鍝佺被鍒槸锛歿{categeryName}}</view>
+ </view>
+</template>
+
+<script>
+ import {
+ getMyActivityList
+ } from '@/api/supplier.js'
+ export default {
+ data() {
+ return {
+ categeryName:'',
+ chooseCategeryId: '',
+ categeryList: [],
+
+ }
+ },
+ methods:{
+ // 鐖剁粍浠惰幏鍙栭�夋嫨鐨勫垎绫�
+ getCategery() {
+ return this.chooseCategeryId
+ },
+ chooseCategery(id,name){
+ this.chooseCategeryId =id
+ this.categeryName = name
+ this.$emit("choose", this.chooseCategeryId)
+ }
+ },
+ async mounted() {
+ const categeryList = await getMyActivityList();
+ this.categeryList = categeryList.data.result;
+ }
+ }
+</script>
+
+<style>
+ .categeryContainer {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ justify-content: flex-start;
+ }
+
+ .categeryItem {
+ height: 120rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .chooseCategeryStyle{
+ color: #e06c75;
+ font-weight: bold;
+ font-size: 1.2em;
+ }
+</style>
\ No newline at end of file
diff --git a/pages/supplier/publish-goods/goodsInfo.vue b/pages/supplier/publish-goods/goodsInfo.vue
new file mode 100644
index 0000000..99ffcf2
--- /dev/null
+++ b/pages/supplier/publish-goods/goodsInfo.vue
@@ -0,0 +1,877 @@
+<template>
+ <view class="add-product-container">
+ <scroll-view scroll-y class="scroll-view">
+ <view class="form-section">
+ <!-- 鍩烘湰淇℃伅 -->
+ <view class="section-title">鍩烘湰淇℃伅</view>
+ <view class="form-item">
+ <text class="label">鍟嗗搧鍚嶇О</text>
+ <input v-model="formData.goodsName" placeholder="璇疯緭鍏ュ晢鍝佸悕绉�" class="input" />
+ </view>
+
+ <view class="form-item">
+ <text class="label">鍟嗗搧浠锋牸</text>
+ <view style="display: flex;align-items: center;">
+ <input v-model="formData.price" type="number" placeholder="璇疯緭鍏ュ晢鍝佷环鏍�" class="input" />
+ <text class="unit">鍏�</text>
+ </view>
+ </view>
+
+ <view class="form-item">
+ <text class="label">鎶芥垚姣斾緥</text>
+ <view style="display: flex;align-items: center;">
+ <input v-model="formData.commission" type="number" placeholder="璇疯緭鍏ユ娊鎴愭瘮渚�" class="input" />
+ <text class="unit">%</text>
+ </view>
+
+ </view>
+
+ <view class="form-item">
+ <text class="label">鍟嗗搧鍗栫偣鎻忚堪</text>
+ <textarea v-model="formData.sellingPoint" placeholder="璇疯緭鍏ュ晢鍝佸崠鐐规弿杩�" class="textarea" />
+ </view>
+
+ <view class="form-item">
+ <text class="label">璁¢噺鍗曚綅</text>
+ <picker @change="onUnitChange" :value="unitIndex" :range="unitOptions" range-key="name" class="picker">
+ <view class="picker-text">{{goodsUnit ? goodsUnit.name : '璇烽�夋嫨璁¢噺鍗曚綅'}}</view>
+ </picker>
+ </view>
+
+ <view class="form-item">
+ <text class="label">閿�鍞ā寮�</text>
+ <radio-group @change="onSalesModeChange" class="radio-group">
+ <label class="radio-label">
+ <radio value="RETAIL" :checked="formData.salesModel === 'RETAIL'" /> 闆跺敭
+ </label>
+ <label class="radio-label">
+ <radio value="PRESALE" :checked="formData.salesModel === 'PRESALE'" /> 棰勫敭
+ </label>
+ </radio-group>
+ </view>
+
+ <view class="form-item" v-if="formData.salesModel === 'PRESALE'">
+ <text class="label">棰勫敭鏃堕棿娈�</text>
+ <view class="date-range-picker">
+ <view class="date-picker-item">
+ <text class="date-label">寮�濮嬫棩鏈�</text>
+ <picker mode="date" @change="onPresaleStartDateChange" class="picker">
+ <view class="picker-text">{{formData.presaleStartDate || '璇烽�夋嫨寮�濮嬫棩鏈�'}}</view>
+ </picker>
+ </view>
+ <view class="date-picker-item">
+ <text class="date-label">缁撴潫鏃ユ湡</text>
+ <picker mode="date" @change="onPresaleEndDateChange" class="picker">
+ <view class="picker-text">{{formData.presaleEndDate || '璇烽�夋嫨缁撴潫鏃ユ湡'}}</view>
+ </picker>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鍟嗗搧涓诲浘 -->
+ <view class="form-item">
+ <text class="label">鍟嗗搧涓诲浘</text>
+ <view class="upload-container">
+ <image v-for="img in formData.goodsGalleryList" :key="img" :src="endpoint + '/' + img" class="uploaded-image" mode="aspectFill" />
+ <view class="upload-btn" @click="uploadMainImage">
+ <uni-icons type="plusempty" size="30" color="#999"></uni-icons>
+ <text class="upload-text">{{formData.goodsGalleryList.length < 1 ? '涓婁紶涓诲浘' : '閲嶆柊涓婁紶'}}</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鍟嗗搧瑙嗛 -->
+ <view class="form-item">
+ <text class="label">鍟嗗搧瑙嗛</text>
+ <view class="upload-container">
+ <video v-show="formData.goodsVideo" :src="endpoint + '/' + formData.goodsVideo" class="uploaded-video" controls></video>
+ <view class="upload-btn" @click="uploadVideo">
+ <uni-icons type="videocam" size="30" color="#999"></uni-icons>
+ <text class="upload-text">{{formData.goodsVideo ? '閲嶆柊涓婁紶' : '涓婁紶瑙嗛'}}</text>
+ </view>
+ <progress v-show="videoUploading" style="width: 100%;" :percent="videoUploadProgress" active-mode="forwards" show-info stroke-width="6" :active="true" active-color="#ff573e" />
+ </view>
+ </view>
+
+ <!-- 瑙勬牸璁剧疆 -->
+ <view class="section-title">瑙勬牸璁剧疆</view>
+ <view class="specs-container">
+ <view class="spec-item" v-for="(spec, specIndex) in formData.specs" :key="specIndex">
+ <view class="spec-header">
+ <input v-model="spec.name" placeholder="瑙勬牸椤瑰悕绉�" class="spec-input" />
+ <uni-icons type="trash" size="20" color="#f56c6c" @click="removeSpec(specIndex)"></uni-icons>
+ </view>
+ <view class="spec-values">
+ <view class="spec-value-tag" v-for="(value, valueIndex) in spec.values" :key="valueIndex">
+ <input v-model="spec.values[valueIndex]" placeholder="瑙勬牸鍊�" class="value-input" />
+ <uni-icons type="clear" size="16" color="#999" @click="removeSpecValue(specIndex, valueIndex)"></uni-icons>
+ </view>
+ <view class="add-value-btn" @click="addSpecValue(specIndex)">
+ <uni-icons type="plusempty" size="16" color="#409eff"></uni-icons>
+ <text>娣诲姞瑙勬牸鍊�</text>
+ </view>
+ </view>
+ </view>
+
+ <view class="add-spec-btn" @click="addSpec">
+ <uni-icons type="plusempty" size="16" color="#409eff"></uni-icons>
+ <text>娣诲姞瑙勬牸椤�</text>
+ </view>
+ </view>
+
+ <!-- 瑙勬牸缁勫悎 -->
+ <view class="section-title" v-if="hasSpecs">瑙勬牸缁勫悎</view>
+ <view class="sku-container" v-if="hasSpecs">
+ <view class="sku-item" v-for="(sku, skuIndex) in formData.skuList" :key="skuIndex">
+ <view class="sku-title">{{sku.specValues.join(' / ')}}</view>
+ <view class="sku-form">
+ <view class="sku-form-item">
+ <text class="sku-label">浠锋牸</text>
+ <view style="display: flex;align-items: center;">
+ <input v-model="sku.price" type="number" placeholder="浠锋牸" class="sku-input" />
+ <text class="sku-unit">鍏�</text>
+ </view>
+ </view>
+ <view class="sku-form-item">
+ <text class="sku-label">閲嶉噺</text>
+ <view style="display: flex;align-items: center;">
+ <input v-model="sku.weight" type="number" placeholder="閲嶉噺" class="sku-input" />
+ <text class="sku-unit">鍏�</text>
+ </view>
+ </view>
+ <view class="sku-form-item">
+ <text class="sku-label">搴撳瓨</text>
+ <view style="display: flex;align-items: center;">
+ <input v-model="sku.quantity" type="number" placeholder="搴撳瓨" class="sku-input" />
+ <text class="sku-unit">浠�</text>
+ </view>
+ </view>
+ <view class="sku-form-item">
+ <text class="sku-label">璐у彿</text>
+ <input v-model="sku.sn" placeholder="璐у彿" class="sku-input" />
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <!-- 鍟嗗搧鎻忚堪 -->
+ <view class="section-title">鍟嗗搧鎻忚堪</view>
+ <view class="form-item">
+ <editor
+ id="editor"
+ class="editor"
+ placeholder="璇疯緭鍏ュ晢鍝佽缁嗘弿杩�"
+ @ready="onEditorReady"
+ @input="onEditorInput">
+ </editor>
+ </view>
+
+ <!-- 鐗╂祦妯℃澘 -->
+ <view class="section-title">鐗╂祦妯℃澘</view>
+ <view class="form-item">
+ <picker @change="onTemplateChange" :value="templateIndex" :range="templateOptions" range-key="name" class="picker">
+ <view class="picker-text">{{shippingTemplate ? shippingTemplate.name : '璇烽�夋嫨鐗╂祦妯℃澘'}}</view>
+ </picker>
+ </view>
+ </view>
+
+ <view class="submit-btn-container">
+ <button type="primary" class="submit-btn" @click="submitForm">鎻愪氦鍟嗗搧</button>
+ </view>
+ </scroll-view>
+ </view>
+</template>
+
+<script>
+ import { getFreightTemplate, getGoodsUnit } from "@/api/store.js"
+ import { getSTSToken } from "@/api/common.js";
+ import { getFileKey } from "@/utils/file.js";
+export default {
+ data() {
+ return {
+ formData: {
+ goodsType: "PHYSICAL_GOODS",
+ updateSku: true,
+ regeneratorSkuFlag: true,
+ goodsName: '', // 鍟嗗搧鍚嶇О
+ price: '', // 鍟嗗搧浠锋牸
+ commission: '', // 鎶芥垚姣斾緥
+ sellingPoint: '', // 鍗栫偣鎻忚堪
+ goodsUnit: '', // 璁¢噺鍗曚綅
+ salesModel: 'RETAIL', // 閿�鍞ā寮�
+ preSaleTime: [], // 棰勫敭鏃堕棿
+ presaleStartDate: '', // 棰勫敭寮�濮嬫棩鏈�
+ presaleEndDate: '', // 棰勫敭缁撴潫鏃ユ湡
+ goodsGalleryList: [], // 涓诲浘
+ goodsVideo: '', // 瑙嗛
+ specs: [], // 瑙勬牸椤�
+ skuList: [], // SKU鍒楄〃
+ mobileIntro: '', // 鍟嗗搧鎻忚堪
+ templateId: null, // 鐗╂祦妯℃澘
+ release: true, // 绔嬪嵆鍙戝竷
+ recommend: false,
+ },
+ shippingTemplate: null, // 閫変腑鐨勭墿娴佹ā鏉�
+ goodsUnit: null, // 閫変腑鐨勮閲忓崟浣�
+ unitOptions: [],
+ unitIndex: -1,
+ templateOptions: [], // 鐗╂祦妯℃澘閫夐」
+ templateIndex: -1,
+ editorCtx: null,
+ cosClient: null,
+ bucket: '',
+ region: '',
+ endpoint: '',
+ videoUploadProgress: 0,
+ videoUploading: false
+ }
+ },
+ computed: {
+ hasSpecs() {
+ return this.formData.specs.length > 0
+ }
+ },
+ mounted() {
+ this.loadShippingTemplates()
+ this.loadGoodsUnit()
+ this.initCOS()
+ },
+ methods: {
+ // 鍒濆鍖栬吘璁簯cos瀹㈡埛绔�
+ async initCOS() {
+ // 璋冪敤鍚庣鑾峰彇sts涓存椂璁块棶鍑瘉
+ getSTSToken().then(res => {
+ const COS = require('@/lib/cos-wx-sdk-v5.js'); // 寮�鍙戞椂浣跨敤
+ // const COS = require('./lib/cos-wx-sdk-v5.min.js'); // 涓婄嚎鏃朵娇鐢ㄥ帇缂╁寘
+
+ // console.log(COS.version); sdk 鐗堟湰闇�瑕佷笉浣庝簬 1.7.2
+ this.cosClient = new COS({
+ SecretId: res.data.data.tmpSecretId, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� secretId
+ SecretKey: res.data.data.tmpSecretKey, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� secretKey
+ SecurityToken: res.data.data.sessionToken, // sts 鏈嶅姟涓嬪彂鐨勪复鏃� SessionToken
+ StartTime: res.data.data.stsStartTime, // 寤鸿浼犲叆鏈嶅姟绔椂闂达紝鍙伩鍏嶅鎴风鏃堕棿涓嶅噯瀵艰嚧鐨勭鍚嶉敊璇�
+ ExpiredTime: res.data.data.stsEndTime, // 涓存椂瀵嗛挜杩囨湡鏃堕棿
+ SimpleUploadMethod: 'putObject', // 寮虹儓寤鸿锛岄珮绾т笂浼犮�佹壒閲忎笂浼犲唴閮ㄥ灏忔枃浠跺仛绠�鍗曚笂浼犳椂浣跨敤 putObject,sdk 鐗堟湰鑷冲皯闇�瑕乿1.3.0
+ });
+ this.bucket = res.data.data.bucket
+ this.region = res.data.data.region
+ this.endpoint = res.data.data.endpoint
+ })
+ },
+ // 鍔犺浇鐗╂祦妯℃澘
+ async loadShippingTemplates() {
+ getFreightTemplate().then(res => {
+ this.templateOptions = res.data.result
+ })
+ },
+ // 鍔犺浇璁¢噺鍗曚綅
+ async loadGoodsUnit() {
+ getGoodsUnit({pageNumber: 1, pageSize: 1000}).then(res => {
+ console.log("璁¢噺鍗曚綅缁撴灉", res.data.result);
+ this.unitOptions = res.data.result.records
+ })
+ },
+ // 璁¢噺鍗曚綅閫夋嫨
+ onUnitChange(e) {
+ this.unitIndex = e.detail.value
+ this.goodsUnit = this.unitOptions[this.unitIndex]
+ },
+
+ // 閿�鍞ā寮忛�夋嫨
+ onSalesModeChange(e) {
+ this.formData.salesModel = e.detail.value
+ },
+
+ // 棰勫敭寮�濮嬫棩鏈熼�夋嫨
+ onPresaleStartDateChange(e) {
+ this.formData.presaleStartDate = e.detail.value
+ this.validateDateRange()
+ },
+
+ // 棰勫敭缁撴潫鏃ユ湡閫夋嫨
+ onPresaleEndDateChange(e) {
+ this.formData.presaleEndDate = e.detail.value
+ this.validateDateRange()
+ },
+
+ // 楠岃瘉鏃ユ湡鑼冨洿
+ validateDateRange() {
+ if (this.formData.presaleStartDate && this.formData.presaleEndDate) {
+ const start = new Date(this.formData.presaleStartDate)
+ const end = new Date(this.formData.presaleEndDate)
+
+ if (start > end) {
+ uni.showToast({
+ title: '缁撴潫鏃ユ湡涓嶈兘鏃╀簬寮�濮嬫棩鏈�',
+ icon: 'none'
+ })
+ this.formData.presaleEndDate = ''
+ }
+ }
+ },
+
+ // 涓婁紶涓诲浘
+ uploadMainImage() {
+ uni.chooseImage({
+ count: 9,
+ sizeType: ['compressed'],
+ sourceType: ['album', 'camera'],
+ success: (res) => {
+ this.formData.goodsGalleryList = []
+ res.tempFilePaths.forEach(tmpImg => {
+ let fileName = tmpImg.substring(tmpImg.lastIndexOf('/') + 1);
+ // 澶勭悊瀹夊崜鍙兘鐨刄RI缂栫爜
+ if(fileName.indexOf('%') > -1) {
+ fileName = decodeURIComponent(fileName);
+ }
+ const fileKey = getFileKey(fileName);
+ this.cosClient.uploadFile({
+ Bucket: this.bucket,
+ Region: this.region,
+ Key: fileKey,
+ FilePath: tmpImg,
+ SliceSize: 1024 * 1024 * 5 /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
+ }, (err, data) => {
+ if (err) {
+ console.log('涓婁紶澶辫触', err);
+ } else {
+ this.formData.goodsGalleryList.push(fileKey);
+ }
+ });
+ })
+ }
+ })
+ },
+
+ // 涓婁紶瑙嗛
+ uploadVideo() {
+ uni.chooseVideo({
+ sourceType: ['album', 'camera'],
+ compressed: true,
+ maxDuration: 30,
+ success: (res) => {
+ const tempFilePath = res.tempFilePath
+ let fileName = tempFilePath.substring(tempFilePath.lastIndexOf('/') + 1);
+ const fileKey = getFileKey(fileName);
+ this.videoUploading = true
+ this.cosClient.uploadFile({
+ Bucket: this.bucket,
+ Region: this.region,
+ Key: fileKey,
+ FilePath: tempFilePath,
+ SliceSize: 1024 * 1024 * 5, /* 瑙﹀彂鍒嗗潡涓婁紶鐨勯槇鍊�,5M */
+ onProgress: (progressData) => {
+ console.log(progressData.percent);
+ this.videoUploadProgress = progressData.percent * 100
+ }
+ }, (err, data) => {
+ if (err) {
+ console.log('涓婁紶澶辫触', err);
+ } else {
+ this.formData.goodsVideo = fileKey
+ }
+ this.videoUploading = false
+ });
+ }
+ })
+ },
+
+ // 娣昏鏍奸」
+ addSpec() {
+ this.formData.specs.push({
+ name: '',
+ values: ['']
+ })
+ },
+
+ // 鍒犻櫎瑙勬牸椤�
+ removeSpec(index) {
+ this.formData.specs.splice(index, 1)
+ this.generateSkuList()
+ },
+
+ // 娣诲姞瑙勬牸鍊�
+ addSpecValue(specIndex) {
+ this.formData.specs[specIndex].values.push('')
+ },
+
+ // 鍒犻櫎瑙勬牸鍊�
+ removeSpecValue(specIndex, valueIndex) {
+ this.formData.specs[specIndex].values.splice(valueIndex, 1)
+ if (this.formData.specs[specIndex].values.length === 0) {
+ this.removeSpec(specIndex)
+ } else {
+ this.generateSkuList()
+ }
+ },
+
+ // 鐢熸垚SKU鍒楄〃
+ generateSkuList() {
+ // 鍏堣繃婊ゆ帀娌℃湁鍚嶇О鐨勮鏍奸」鍜屾病鏈夊�肩殑瑙勬牸鍊�
+ const validSpecs = this.formData.specs.filter(spec =>
+ spec.name && spec.values.filter(v => v).length > 0
+ )
+
+ if (validSpecs.length === 0) {
+ this.formData.skuList = []
+ return
+ }
+
+ // 鐢熸垚鎵�鏈夊彲鑳界殑缁勫悎
+ let combinations = [{
+ price: '',
+ weight: '',
+ quantity: '',
+ sn: '',
+ specValues: [] // 淇濈暀specValues鏁扮粍
+ }]
+
+ validSpecs.forEach(spec => {
+ const newCombinations = []
+ combinations.forEach(combination => {
+ spec.values.filter(v => v).forEach(value => {
+ // 鍒涘缓鏂扮殑缁勫悎瀵硅薄
+ const newCombination = {
+ ...combination,
+ [spec.name]: value, // 娣诲姞瑙勬牸閿�煎
+ specValues: [...combination.specValues, value] // 淇濈暀瑙勬牸鍊兼暟缁�
+ }
+ newCombinations.push(newCombination)
+ })
+ })
+ combinations = newCombinations
+ })
+
+ // 淇濈暀宸叉湁鐨凷KU鏁版嵁
+ const existingSkus = this.formData.skuList || []
+ const newSkuList = combinations.map(comb => {
+ // 鏌ユ壘鍖归厤鐨勭幇鏈塖KU锛堝悓鏃舵鏌pecValues鍜岃鏍奸敭鍊煎锛�
+ const existingSku = existingSkus.find(sku => {
+ // 妫�鏌pecValues鏁扮粍鏄惁鍖归厤
+ const specValuesMatch = sku.specValues && comb.specValues &&
+ sku.specValues.length === comb.specValues.length &&
+ sku.specValues.every((v, i) => v === comb.specValues[i])
+
+ // 妫�鏌ユ墍鏈夎鏍奸敭鏄惁鍖归厤
+ const specsMatch = validSpecs.every(spec => {
+ return sku[spec.name] === comb[spec.name]
+ })
+
+ return specValuesMatch && specsMatch
+ })
+ return existingSku || comb
+ })
+
+ this.formData.skuList = newSkuList
+ },
+
+ // 鐗╂祦妯℃澘閫夋嫨
+ onTemplateChange(e) {
+ this.templateIndex = e.detail.value
+ console.log("閫変腑鐨勭墿娴佹ā鏉�", this.templateOptions[this.templateIndex]);
+ this.shippingTemplate = this.templateOptions[this.templateIndex]
+ },
+
+ // 缂栬緫鍣ㄥ噯澶囧氨缁�
+ onEditorReady() {
+ uni.createSelectorQuery().select('#editor').context((res) => {
+ this.editorCtx = res.context
+ }).exec()
+ },
+
+ // 缂栬緫鍣ㄥ唴瀹瑰彉鍖�
+ onEditorInput(e) {
+ this.formData.mobileIntro = e.detail.html
+ },
+
+ // 琛ㄥ崟楠岃瘉
+ validateForm() {
+ if (!this.formData.goodsName) {
+ uni.showToast({ title: '璇疯緭鍏ュ晢鍝佸悕绉�', icon: 'none' })
+ return false
+ }
+
+ if (!this.formData.price) {
+ uni.showToast({ title: '璇疯緭鍏ュ晢鍝佷环鏍�', icon: 'none' })
+ return false
+ }
+
+ if (!this.formData.commission) {
+ uni.showToast({ title: '璇疯緭鍏ユ娊鎴愭瘮渚�', icon: 'none' })
+ return false
+ }
+
+ if (!this.goodsUnit) {
+ uni.showToast({ title: '璇烽�夋嫨璁¢噺鍗曚綅', icon: 'none' })
+ return false
+ }
+
+ if (this.formData.salesModel === 'PRESALE' && !this.formData.presaleEndDate) {
+ uni.showToast({ title: '璇烽�夋嫨棰勫敭鎴鏃ユ湡', icon: 'none' })
+ return false
+ }
+
+ if (!this.formData.goodsGalleryList) {
+ uni.showToast({ title: '璇蜂笂浼犲晢鍝佷富鍥�', icon: 'none' })
+ return false
+ }
+
+ if (!this.formData.goodsVideo) {
+ uni.showToast({ title: '璇蜂笂浼犲晢鍝佽棰�', icon: 'none' })
+ return false
+ }
+
+ // 楠岃瘉瑙勬牸椤�
+ for (const spec of this.formData.specs) {
+ if (!spec.name) {
+ uni.showToast({ title: '璇峰~鍐欒鏍奸」鍚嶇О', icon: 'none' })
+ return false
+ }
+
+ if (spec.values.filter(v => v).length === 0) {
+ uni.showToast({ title: '姣忎釜瑙勬牸椤硅嚦灏戦渶瑕佷竴涓鏍煎��', icon: 'none' })
+ return false
+ }
+ }
+
+ // 楠岃瘉SKU
+ if (this.formData.skuList.length > 0) {
+ for (const sku of this.formData.skuList) {
+ if (!sku.price) {
+ uni.showToast({ title: '璇峰~鍐欐墍鏈夎鏍肩殑浠锋牸', icon: 'none' })
+ return false
+ }
+
+ if (!sku.quantity) {
+ uni.showToast({ title: '璇峰~鍐欐墍鏈夎鏍肩殑搴撳瓨', icon: 'none' })
+ return false
+ }
+ }
+ }
+
+ if (!this.shippingTemplate) {
+ uni.showToast({ title: '璇烽�夋嫨鐗╂祦妯℃澘', icon: 'none' })
+ return false
+ }
+
+ return true
+ },
+
+ // 鎻愪氦琛ㄥ崟
+ submitForm() {
+ if (!this.validateForm()) return
+ const data = this.formData
+ if (data.skuList) {
+ data.skuList.forEach(sku => {
+ sku['cost'] = 1
+ sku['images'] = []
+ })
+ }
+ data.preSaleTime = [this.formData.presaleStartDate, this.formData.presaleEndDate]
+ data.templateId = this.shippingTemplate.id
+ data.goodsUnit = this.goodsUnit.name
+ this.$emit("submit", data)
+ }
+ },
+
+ watch: {
+ 'formData.specs': {
+ deep: true,
+ handler() {
+ this.generateSkuList()
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.add-product-container {
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ background-color: #f5f5f5;
+}
+
+.scroll-view {
+ flex: 1;
+ height: 100%;
+}
+
+.form-section {
+ padding: 20rpx 0rpx;
+}
+
+.section-title {
+ font-size: 32rpx;
+ font-weight: bold;
+ margin: 30rpx 0 20rpx;
+ color: #333;
+ padding-left: 10rpx;
+ border-left: 6rpx solid #409eff;
+}
+
+.form-item {
+ background-color: #fff;
+ padding: 25rpx;
+ margin-bottom: 20rpx;
+ border-radius: 12rpx;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+}
+
+.label {
+ display: block;
+ font-size: 28rpx;
+ color: #666;
+ margin-bottom: 15rpx;
+}
+
+.input {
+ height: 80rpx;
+ font-size: 28rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 0 20rpx;
+ background-color: #f9f9f9;
+}
+
+.textarea {
+ height: 150rpx;
+ font-size: 28rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 20rpx;
+ background-color: #f9f9f9;
+}
+
+.unit {
+ margin-left: 10rpx;
+ color: #999;
+}
+
+.picker {
+ height: 80rpx;
+ line-height: 80rpx;
+ font-size: 28rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 0 20rpx;
+ background-color: #f9f9f9;
+}
+
+.picker-text {
+ color: #333;
+}
+
+
+.date-range-picker {
+ display: flex;
+ justify-content: space-between;
+}
+
+.date-picker-item {
+ width: 48%;
+}
+
+.date-label {
+ display: block;
+ font-size: 26rpx;
+ color: #666;
+ margin-bottom: 10rpx;
+}
+
+.date-range-hint {
+ font-size: 24rpx;
+ color: #999;
+ margin-top: 10rpx;
+ text-align: right;
+}
+
+.radio-group {
+ display: flex;
+}
+
+.radio-label {
+ margin-right: 40rpx;
+ font-size: 28rpx;
+}
+
+.upload-container {
+ margin-top: 15rpx;
+}
+
+.upload-btn {
+ width: 200rpx;
+ height: 200rpx;
+ border: 1rpx dashed #ccc;
+ border-radius: 8rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ color: #999;
+}
+
+.upload-text {
+ margin-top: 10rpx;
+ font-size: 24rpx;
+}
+
+.uploaded-image {
+ width: 200rpx;
+ height: 200rpx;
+ border-radius: 8rpx;
+}
+
+.uploaded-video {
+ width: 100%;
+ height: 400rpx;
+ border-radius: 8rpx;
+}
+
+.specs-container {
+ margin-bottom: 30rpx;
+}
+
+.spec-item {
+ background-color: #fff;
+ padding: 20rpx;
+ margin-bottom: 20rpx;
+ border-radius: 12rpx;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+}
+
+.spec-header {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20rpx;
+}
+
+.spec-input {
+ flex: 1;
+ height: 70rpx;
+ font-size: 28rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 0 20rpx;
+ background-color: #f9f9f9;
+ margin-right: 20rpx;
+}
+
+.spec-values {
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.spec-value-tag {
+ display: flex;
+ align-items: center;
+ background-color: #f5f7fa;
+ padding: 10rpx 20rpx;
+ border-radius: 40rpx;
+ margin-right: 15rpx;
+ margin-bottom: 15rpx;
+}
+
+.value-input {
+ width: 120rpx;
+ font-size: 26rpx;
+ background-color: transparent;
+ margin-right: 10rpx;
+}
+
+.add-value-btn {
+ display: flex;
+ align-items: center;
+ color: #409eff;
+ font-size: 26rpx;
+ padding: 10rpx 15rpx;
+}
+
+.add-spec-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #409eff;
+ font-size: 28rpx;
+ padding: 20rpx;
+ border: 1rpx dashed #409eff;
+ border-radius: 8rpx;
+ margin-top: 10rpx;
+}
+
+.sku-container {
+ margin-bottom: 30rpx;
+}
+
+.sku-item {
+ background-color: #fff;
+ padding: 20rpx;
+ margin-bottom: 20rpx;
+ border-radius: 12rpx;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+}
+
+.sku-title {
+ font-size: 28rpx;
+ color: #333;
+ margin-bottom: 20rpx;
+ font-weight: bold;
+}
+
+.sku-form {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+}
+
+.sku-form-item {
+ width: 48%;
+ margin-bottom: 15rpx;
+}
+
+.sku-label {
+ display: block;
+ font-size: 26rpx;
+ color: #666;
+ margin-bottom: 10rpx;
+}
+
+.sku-input {
+ height: 70rpx;
+ font-size: 26rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 0 20rpx;
+ background-color: #f9f9f9;
+ width: 100%;
+}
+
+.sku-unit {
+ margin-left: 10rpx;
+ color: #999;
+ font-size: 26rpx;
+}
+
+.editor {
+ height: 400rpx;
+ background-color: #f9f9f9;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ padding: 20rpx;
+}
+
+.submit-btn-container {
+ padding-bottom: 150px;
+ background-color: #fff;
+}
+
+.submit-btn {
+ width: 100%;
+ height: 90rpx;
+ line-height: 90rpx;
+ font-size: 32rpx;
+ border-radius: 45rpx;
+ background-color: #409eff;
+}
+</style>
\ No newline at end of file
diff --git a/pages/supplier/publish-goods/publishGoods.vue b/pages/supplier/publish-goods/publishGoods.vue
new file mode 100644
index 0000000..8b0daeb
--- /dev/null
+++ b/pages/supplier/publish-goods/publishGoods.vue
@@ -0,0 +1,85 @@
+<template>
+ <view class="container">
+ <uni-steps :options="publishSteps" :active="currentStep" active-color='#f31947'></uni-steps>
+ <choose-categery @choose="chooseCategrey" v-show="currentStep === 0"></choose-categery>
+ <goods-info @submit="submit" v-show="currentStep === 1"></goods-info>
+ <view style="position: fixed;bottom: 80px;display: flex;width: calc(100% - 70rpx);">
+ <button :disabled="currentStep === 0" @click="lastStep" size="mini" style="flex: 1;font-size: 32rpx;margin-right: 3rpx;" type="primary">涓婁竴姝�</button>
+ <button :disabled="currentStep === 1" @click="nextStep" size="mini" style="flex: 1;font-size: 32rpx;margin-left: 3rpx;" type="primary">涓嬩竴姝�</button>
+ </view>
+ </view>
+</template>
+
+<script>
+ import chooseCategery from './chooseCategery.vue';
+ import goodsInfo from './goodsInfo.vue';
+ import {createGoods} from "@/api/store.js"
+ export default {
+ components: { chooseCategery, goodsInfo },
+ data() {
+ return {
+ goods: {
+
+ },
+ categoryPath: '',
+ currentStep:0,
+ publishSteps: [{
+ title: ' 閫夋嫨鍟嗗搧鍝佺被'
+ },
+ {
+ title: ' 濉啓鍟嗗搧璇︽儏'
+ }
+ ],
+ }
+ },
+ methods: {
+ // 鑾峰彇閫夋嫨鐨勫晢鍝佸垎绫�
+ chooseCategrey(categreyId) {
+ this.categoryPath = categreyId + ",,"
+ },
+ submit(data) {
+ if (! this.categoryPath) {
+ uni.showToast({ title: '璇烽�変腑鍟嗗搧鍒嗙被', icon: 'none' })
+ return
+ }
+ data['categoryPath'] = this.categoryPath
+ if (data.skuList) {
+ data.skuList.forEach(sku => {
+ delete sku.specValues
+ })
+ }
+ delete data.specs
+ // 鍙戝竷鍟嗗搧
+ console.log("鍟嗗搧鏁版嵁", data);
+ createGoods(data).then(res => {
+ uni.showToast({ title: '鍟嗗搧宸叉彁浜ゅ鏍�', icon: 'success' })
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1
+ });
+ }, 2000)
+ })
+ },
+ // 涓婁竴姝�
+ lastStep() {
+ if (this.currentStep > 0) {
+ this.currentStep--
+ }
+ },
+ // 涓嬩竴姝�
+ nextStep() {
+ if (this.currentStep < 1) {
+ this.currentStep++
+ }
+ }
+ }
+ }
+</script>
+
+<style>
+ .container {
+ width: 750rpx;
+ padding: 32rpx;
+ box-sizing: border-box;
+ }
+</style>
\ No newline at end of file
diff --git "a/pages/supplier/suppler-order/order-detail - \345\211\257\346\234\254.vue" "b/pages/supplier/suppler-order/order-detail - \345\211\257\346\234\254.vue"
new file mode 100644
index 0000000..1848bff
--- /dev/null
+++ "b/pages/supplier/suppler-order/order-detail - \345\211\257\346\234\254.vue"
@@ -0,0 +1,69 @@
+<template>
+ <view class="container">
+ <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="鏆傛棤鏇村鏁版嵁"
+ @selection-change="selectionChange">
+ <uni-tr>
+ <uni-th width="40" align="center">鍟嗗搧 </uni-th>
+ <uni-th width="50" align="center">鍗曚环</uni-th>
+ <uni-th width="50">鏁伴噺</uni-th>
+ <uni-th width="20">宸插彂鍖呰9 </uni-th>
+ <uni-th width="20">灏忚 </uni-th>
+ </uni-tr>
+ <uni-tr v-for="(item, index) in tableData" :key="index">
+ <uni-td>{{ item.date }}</uni-td>
+ <uni-td>
+ <view class="name">{{ item.name }}</view>
+ </uni-td>
+ <uni-td align="center">{{ item.address }}</uni-td>
+ <uni-td>
+ <view class="uni-group">
+ <button class="uni-button" size="mini" type="primary">淇敼</button>
+ <button class="uni-button" size="mini" type="warn">鍒犻櫎</button>
+ </view>
+ </uni-td>
+ </uni-tr>
+ </uni-table>
+ </view>
+</template>
+
+<script>
+ import {
+ supplierOrderDetail
+ } from '@/api/supplier.js'
+ export default {
+ data() {
+ return {
+ tableData: [],
+ loading: false,
+ selectedIndexs: []
+
+ }
+ },
+ methods: {
+ methods: {
+ // 澶氶�夊鐞�
+ selectedItems() {
+ if(this.tableData.length == 0) return
+ return this.selectedIndexs.map(i => this.tableData[i])
+ },
+ // 澶氶��
+ selectionChange(e) {
+ console.log(e.detail.index)
+ this.selectedIndexs = e.detail.index
+ },
+ },
+ async onLoad(query) {
+ // const {
+ // order_sn
+ // } = query
+ const order_sn = 'O202507091942755596113694720'
+ const orderDetail = await supplierOrderDetail(order_sn);
+ this.tableData = orderDetail.data.result.orderItems
+ console.log('------------------------------>', JSON.stringify(this.tableData))
+ }
+ }
+ }
+</script>
+
+<style>
+</style>
\ No newline at end of file
diff --git a/pages/supplier/suppler-order/order-detail.vue b/pages/supplier/suppler-order/order-detail.vue
new file mode 100644
index 0000000..b9c7906
--- /dev/null
+++ b/pages/supplier/suppler-order/order-detail.vue
@@ -0,0 +1,471 @@
+<template>
+ <view class="container">
+ <!-- 鐗╂祦淇℃伅鍗$墖 -->
+ <input type="text" v-model="flushDom" v-show="true" />
+ <view class="card delivery-info">
+ <view class="section-title">鐗╂祦淇℃伅</view>
+ <view class="userInfo">
+ <view class="name">
+ <text>濮撳悕锛�</text> {{order.consigneeName}}</view>
+ <view class="phone"><text>鑱旂郴鐢佃瘽:</text> {{order.consigneeMobile}}</view>
+ <view class="addresss"><text>鍦板潃锛�</text> {{order.consigneeAddressPath}}</view>
+ </view>
+ <view class="form-item">
+ <picker @change="selectLogistics" :value="logisticsIndex" :range="logisticsList" range-key="name"
+ class="picker">
+ <view class="input">
+ {{ selectedLogistics ? selectedLogistics.name : '璇烽�夋嫨鐗╂祦鍏徃' }}
+ </view>
+ </picker>
+ </view>
+
+ <view class="form-item">
+ <input v-model="trackingNumber" placeholder="濉啓蹇�掑崟鍙�" class="input" />
+ <!-- <button class="scan-btn" @click="scanBarcode">
+ <uni-icons type="scan" size="20" color="#fff" />
+ </button> -->
+ </view>
+ </view>
+
+ <!-- 鍟嗗搧鍒楄〃 -->
+ <view class="card">
+ <view class="section-title">閫夋嫨鍙戣揣鍟嗗搧</view>
+ <view class="goods-list">
+ <view v-for="(item, index) in goodsList" :key="item.id" class="goods-item">
+ <view class="goods-info">
+ <image :src="item.image" class="goods-image" />
+ <view class="goods-detail">
+ <text class="goods-name">{{ item.goodsName }}</text>
+ <view class="goods-meta">
+ <text class="goods-price">楼{{ item.unitPrice.toFixed(2) }}</text>
+ <text class="goods-stock">鍟嗗搧鏁伴噺: {{ item.num }}</text>
+ </view>
+ </view>
+ </view>
+
+ <view class="quantity-control">
+ <text class="label">鍙戣揣鏁伴噺:</text>
+ <view class="quantity-selector">
+ <button class="btn-minus" :disabled="item.selected <= 0" @click="adjustQuantity(index, -1)">
+ -
+ </button>
+ <input v-model.number="item.selected" type="number" :min="0" :max="item.num"
+ @blur="validateQuantity(index,item.selected)" class="input-quantity"
+ :disabled="item.num==0" />
+ <button class="btn-plus" :disabled="item.selected >= item.num"
+ @click="adjustQuantity(index, 1)">
+ +
+ </button>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鏍� -->
+ <view class="action-bar">
+ <view class="summary">
+ <text>鍏� {{ totalSelected }} 浠跺晢鍝�</text>
+ <text class="total-amount">鍚堣: 楼{{ totalAmount.toFixed(2) }}</text>
+ </view>
+ <button class="submit-btn" :class="{ disabled: !canSubmit }" @click="submitDelivery">
+ 纭鍙戣揣
+ </button>
+ </view>
+ </view>
+</template>
+
+<script>
+ import {
+ supplierOrderDetail,
+ getChecked,
+ partDelivery
+ } from '@/api/supplier.js'
+ export default {
+ data() {
+ return {
+ logisticsIndex: -1,
+ logisticsList: [],
+ trackingNumber: '',
+ goodsList: [],
+ orderSn: '',
+ flushDom: '',
+ order:{}
+ }
+ },
+ computed: {
+ // 褰撳墠閫変腑鐨勭墿娴佸叕鍙�
+ selectedLogistics() {
+ return this.logisticsIndex >= 0 ?
+ this.logisticsList[this.logisticsIndex] :
+ null
+ },
+
+ // 宸查�夊晢鍝佹�绘暟
+ totalSelected() {
+ return this.goodsList.reduce((sum, item) => sum + item.selected, 0)
+ },
+
+ // 鎬婚噾棰�
+ totalAmount() {
+ return this.goodsList.reduce(
+ (sum, item) => sum + (item.unitPrice * item.selected),
+ 0
+ )
+ },
+
+ // 鏄惁鍙互鎻愪氦
+ canSubmit() {
+ return this.selectedLogistics &&
+ this.trackingNumber.trim() &&
+ this.totalSelected > 0
+ }
+ },
+ methods: {
+ // 閫夋嫨鐗╂祦鍏徃
+ selectLogistics(e) {
+ this.logisticsIndex = e.detail.value
+ },
+
+ // 鎵爜蹇�掑崟鍙�
+ scanBarcode() {
+ uni.scanCode({
+ success: res => {
+ this.trackingNumber = res.result
+ },
+ fail: err => {
+ uni.showToast({
+ title: '鎵爜澶辫触',
+ icon: 'none'
+ })
+ }
+ })
+ },
+
+ // 璋冩暣鍟嗗搧鏁伴噺
+ adjustQuantity(index, delta) {
+ const newVal = this.goodsList[index].selected + delta
+ if (newVal >= 0 && newVal <= this.goodsList[index].num) {
+ this.goodsList[index].selected = newVal
+ }
+ },
+
+ // 鏍¢獙鏁伴噺杈撳叆
+ validateQuantity(index, selected) {
+ const item = this.goodsList[index]
+ if (item.selected < 0) {
+ item.selected = 0
+ }
+ if (item.selected > item.num) {
+ item.selected = item.num
+ }
+ },
+ async loadData(order_sn) {
+ this.goodsList = [];
+ this.order = {};
+ const orderDetail = await supplierOrderDetail(order_sn);
+ this.order = orderDetail.data.result.order
+ this.orderSn = order_sn;
+ this.goodsList = orderDetail.data.result.orderItems.map(item => {
+ const remain = item.num - item.deliverNumber
+ return {
+ image: item.image,
+ id: item.id,
+ goodsName: item.goodsName,
+ unitPrice: item.unitPrice,
+ num: remain,
+ selected: remain,
+ orderSn: item.orderSn
+ }
+ })
+ },
+ // 鎻愪氦鍙戣揣
+ async submitDelivery() {
+ if (!this.canSubmit) return
+ uni.showModal({
+ title: "鏄惁纭鍙戣揣",
+ success: async(e)=> {
+ if (e.confirm) {
+
+ // 鏋勫缓鍙戣揣鍟嗗搧鏁版嵁
+ const deliveryItems = this.goodsList
+ .filter(item => item.selected > 0)
+ .map(item => ({
+ orderItemId: item.id,
+ deliveryNum: item.selected,
+ }))
+
+ const deliveryData = {
+ logisticsId: this.selectedLogistics.id,
+ logisticsNo: this.trackingNumber,
+ partDeliveryDTOList: deliveryItems,
+ orderSn: this.orderSn
+ }
+
+ uni.showLoading({
+ title: '鎻愪氦涓�...',
+ mask: true
+ })
+ // 瀹為檯椤圭洰涓皟鐢ˋPI鎺ュ彛
+ // 杩欓噷浣跨敤妯℃嫙鎻愪氦
+ try {
+ const delivery = await partDelivery(this.orderSn, deliveryData)
+ if (delivery.code == 200) {
+ uni.showToast({
+ title: '鍙戣揣鎴愬姛',
+ icon: 'success',
+ success: () => {
+ // 杩斿洖涓婁竴椤垫垨璺宠浆鍒扮粨鏋滈〉
+ setTimeout(() => uni.navigateBack(), 1500)
+ }
+ })
+ }
+ } finally {
+ uni.hideLoading()
+ await this.loadData(this.orderSn)
+ }
+ }
+ }
+ })
+
+ }
+ },
+
+ async onLoad(query) {
+ const {
+ order_sn
+ } = query
+ // const orderDetail = await supplierOrderDetail(order_sn);
+ // this.orderSn = order_sn;
+ // this.goodsList = orderDetail.data.result.orderItems.map(item => {
+ // console.log('------------------------------>', item.num, item.deliverNumber)
+ // const remain = item.num - item.deliverNumber
+ // return {
+ // image: item.image,
+ // id: item.id,
+ // goodsName: item.goodsName,
+ // unitPrice: item.unitPrice,
+ // num: remain,
+ // selected: remain,
+ // orderSn: item.orderSn
+ // }
+ // })
+ await this.loadData(order_sn);
+ const checked = await getChecked();
+ this.logisticsList = checked.data.result.map(item => {
+ return {
+ id: item.logisticsId,
+ name: item.name,
+ code: item.logisticsId
+
+ }
+ })
+ }
+ }
+</script>
+
+<style scoped>
+ /* 鏍峰紡淇濇寔涓嶅彉 */
+ .container {
+ padding: 20rpx;
+ background-color: #f5f5f5;
+ height: calc(100vh - env(safe-area-inset-bottom));
+ overflow: auto;
+ padding-bottom: env(safe-area-inset-bottom);
+
+ }
+
+ .card {
+ background-color: #fff;
+ border-radius: 16rpx;
+ padding: 30rpx;
+ margin-bottom: 20rpx;
+ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
+ }
+
+ .section-title {
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #333;
+ margin-bottom: 30rpx;
+ padding-bottom: 20rpx;
+ border-bottom: 1rpx solid #eee;
+ }
+
+ .form-item {
+ margin-top: 30rpx;
+ margin-bottom: 30rpx;
+ position: relative;
+ }
+
+ .picker {
+ width: 100%;
+ font-size: 32rpx;
+ }
+
+ .input {
+ height: 88rpx;
+ line-height: 88rpx;
+ padding: 0 30rpx;
+ background-color: #f9f9f9;
+ border-radius: 12rpx;
+ font-size: 28rpm;
+ color: #333;
+ border: 1rpx solid #eee;
+ }
+
+ .scan-btn {
+ position: absolute;
+ right: 10rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 80rpx;
+ height: 70rpx;
+ background-color: #2979ff;
+ border-radius: 8rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 0;
+ }
+
+ .goods-item {
+ padding: 30rpx 0;
+ border-bottom: 1rpx solid #f0f0f0;
+ }
+
+ .goods-item:last-child {
+ border-bottom: none;
+ }
+
+ .goods-info {
+ display: flex;
+ align-items: center;
+ margin-bottom: 30rpx;
+ }
+
+ .goods-image {
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 8rpx;
+ margin-right: 20rpx;
+ }
+
+ .goods-detail {
+ flex: 1;
+ }
+
+ .goods-name {
+ font-size: 28rpx;
+ color: #333;
+ line-height: 1.5;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+ }
+
+ .goods-meta {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 15rpx;
+ }
+
+ .goods-price {
+ font-size: 32rpx;
+ color: #e64340;
+ font-weight: bold;
+ }
+
+ .goods-stock {
+ font-size: 26rpx;
+ color: #999;
+ }
+
+ .quantity-control {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .label {
+ font-size: 28rpx;
+ color: #666;
+ }
+
+ .quantity-selector {
+ display: flex;
+ align-items: center;
+ }
+
+ .btn-minus,
+ .btn-plus {
+ width: 60rpx;
+ height: 60rpx;
+ background-color: #f5f5f5;
+ border-radius: 50%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 36rpx;
+ color: #666;
+ padding: 0;
+ }
+
+ .btn-minus[disabled],
+ .btn-plus[disabled] {
+ opacity: 0.4;
+ }
+
+ .input-quantity {
+ width: 100rpx;
+ height: 60rpx;
+ text-align: center;
+ font-size: 32rpx;
+ margin: 0 15rpx;
+ border: 1rpx solid #eee;
+ border-radius: 8rpx;
+ }
+
+ .action-bar {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 100rpx;
+ background-color: #fff;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 30rpx;
+ box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
+ z-index: 100;
+ margin-bottom: env(safe-area-inset-bottom);
+ }
+
+ .summary {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .total-amount {
+ font-size: 32rpx;
+ color: #e64340;
+ font-weight: bold;
+ margin-top: 6rpx;
+ }
+
+ .submit-btn {
+ background-color: #2979ff;
+ color: #fff;
+ height: 80rpx;
+ line-height: 80rpx;
+ border-radius: 40rpx;
+ font-size: 30rpx;
+ padding: 0 50rpx;
+ }
+
+ .submit-btn.disabled {
+ background-color: #cccccc;
+ }
+</style>
\ No newline at end of file
diff --git a/pages/supplier/suppler-order/suppler-order.vue b/pages/supplier/suppler-order/suppler-order.vue
index df4e95d..76b984c 100644
--- a/pages/supplier/suppler-order/suppler-order.vue
+++ b/pages/supplier/suppler-order/suppler-order.vue
@@ -106,6 +106,7 @@
shape="circle"
size="mini"
v-if="order.orderStatus==='UNDELIVERED'"
+ @click="navigationToOrderDetail(order.sn)"
>鍙戣揣</view
>
<!-- 绛夊緟鏀惰揣 -->
@@ -134,6 +135,7 @@
<script>
import '@/components/uview-components/uview-ui';
import { getOrderXcxList, cancelOrder, confirmReceipt ,getOrderDetail} from "@/api/order.js";
+import{supplierOrderList} from '@/api/supplier.js'
import { getClearReason } from "@/api/after-sale.js";
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
export default {
@@ -263,6 +265,9 @@
* 淇app绔偣鍑婚櫎鍏ㄩ儴璁㈠崟澶栫殑鎸夐挳杩涘叆鏃朵笉鍔犺浇鏁版嵁鐨勯棶棰�
* 鏇挎崲onLoad涓嬩唬鐮佸嵆鍙�
*/
+ if(!options.status){
+ options.status = 0
+ }
let status = Number(options.status);
this.status = status;
@@ -286,6 +291,11 @@
},
},
methods: {
+ navigationToOrderDetail(snNo){
+ uni.navigateTo({
+ url:`/pages/supplier/suppler-order/order-detail?order_sn=${snNo}`
+ })
+ },
async selectPhone(sn){
const orderInfo = await getOrderDetail(sn)
console.log('----------------->',orderInfo)
@@ -295,8 +305,15 @@
this.userInfo.address = orderInfo.data.result.order.consigneeAddressPath
uni.showModal({
- title:"鐢ㄦ埛鑱旂郴鐢佃瘽",
- content:orderInfo.data.result.order.consigneeMobile
+ title:orderInfo.data.result.order.consigneeName + '锛堝厛鐢�/濂冲+锛�',
+ content:orderInfo.data.result.order.consigneeMobile,
+ success(e) {
+ if(e.confirm){
+ uni.makePhoneCall({
+ phoneNumber:orderInfo.data.result.order.consigneeMobile
+ })
+ }
+ }
})
},
@@ -316,7 +333,7 @@
loadData(index) {
this.params.pageNumber = this.navList[index].pageNumber;
// this.params.tag = this.orderStatus[index].orderStatus;
- getOrderXcxList(this.params).then((res) => {
+ supplierOrderList(this.params).then((res) => {
uni.stopPullDownRefresh();
if (!res.data.success) {
this.navList[index].loadStatus = "noMore";
@@ -367,83 +384,7 @@
stateTipColor,
};
},
- /**
- * 閫夋嫨鍙栨秷鍘熷洜
- */
- reasonChange(reason) {
- this.reason = reason;
- },
- /**
- * 鎻愪氦鍙栨秷璁㈠崟锛堟湭浠樻锛�
- */
- submitCancel() {
- cancelOrder(this.orderSn, { reason: this.reason }).then((res) => {
- if (res.data.success) {
- uni.showToast({
- title: "璁㈠崟宸插彇娑�",
- duration: 2000,
- icon: "none",
- });
- this.initData(this.tabCurrentIndex);
-
- this.cancelShow = false;
- } else {
- uni.showToast({
- title: res.data.message,
- duration: 2000,
- icon: "none",
- });
- this.cancelShow = false;
- }
- });
- },
-
- /**
- * 纭鏀惰揣鏄剧ず
- */
- onRog(sn) {
- this.orderSn = sn;
- this.rogShow = true;
- },
-
- /**
- * 鐐瑰嚮纭鏀惰揣
- */
- confirmRog() {
- confirmReceipt(this.orderSn).then((res) => {
- if (res.data.code == 200) {
- uni.showToast({
- title: "宸茬‘璁ゆ敹璐�",
- duration: 2000,
- icon: "none",
- });
- this.initData(this.tabCurrentIndex);
- this.rogShow = false;
- }
- });
- },
-
- /**
- * 璇勪环鍟嗗搧
- */
- onComment(sn) {
- uni.navigateTo({
- url: "./evaluate/myEvaluate",
- });
- },
-
- /**
- * 閲嶆柊璐拱
- */
- reBuy(order) {
- console.log(order);
- return;
- uni.navigateTo({
- url:
- "/pages/product/goods?id=" + order.id + "&goodsId=" + order.goodsId,
- });
- },
/**
* 鏌ョ湅鐗╂祦
@@ -451,7 +392,7 @@
navigateToLogistics(order) {
uni.navigateTo({
url:
- "/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
+ `/pages/order/deliverDetail?order_sn=${order.sn}`,
});
},
},
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index 4589ccd..d9d53cd 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -14,7 +14,7 @@
>
<swiper-item
v-for="(item, index) in videoList"
- :key="item.id"
+ :key="item.updateKey"
@touchstart="handleSwiperStart"
@touchmove="handleSwiperMove"
@touchend="handleSwiperEnd(item)"
@@ -120,21 +120,23 @@
<!-- 瑙嗛淇℃伅灞� -->
<view class="video-info" :style="{bottom: marginBottom + 20 + 'px'}">
- <view>
- <text class="video-author" @click="jumpToSearch">@{{item.authorName}}</text>
+ <view style="width: 100%; position: relative;">
+ <text class="video-author">@{{item.authorName}}</text>
+ <text class="iconfont" @click="jumpToSearch" style="position: absolute;right: 45px;"></text>
</view>
<view style="width: 100%;word-wrap: break-word;white-space: normal;overflow-wrap: break-word;">
<text class="video-title">{{item.title}}</text>
<text class="video-tag" v-for="(tag, index) in item.tagList" :key="tag.id">#{{tag.tagName}}</text>
</view>
+
</view>
<!-- 鍙充晶浜掑姩鎸夐挳 -->
<view class="action-buttons">
<view class="avatar-container">
- <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
+ <image class="avatar" @click="jumpToHomePage(item.authorId)" @touchend.stop :src="item.authorAvatar" mode="aspectFill"></image>
<!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
- <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
+ <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)" @touchend.stop>
<text class="iconfont"></text>
</view>
</view>
@@ -256,6 +258,7 @@
thubmsUpComment,
cancelThubmsUpComment,
changeThumbsUp,
+ getGoodsSimilarlyVideos
} from "@/api/video.js";
import { changeCollect } from "@/api/collect.js";
import { saveShare, saveShareClickRecord } from "@/api/share.js";
@@ -341,6 +344,17 @@
pageSize: 10,
videoFrom: 'recommend'
},
+ goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
+ pageNumber: 1,
+ pageSize: 10,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ },
+ similarlyVideoList: [], // 鐩镐技瑙嗛
+ similarlyNomore: false, // 鏄惁杩樻湁鏇村鐩镐技瑙嗛
+ similaryVideoIndex: 0, // 鐩镐技瑙嗛鐨勬挱鏀句綅缃�
+ similarlyLoading: false, // 鐩镐技瑙嗛鍔犺浇
marginBottom: 0 // 搴曢儴瀹夊叏鍖哄煙
}
},
@@ -353,6 +367,9 @@
// } else {
// this.loadVideos();
// }
+ if (this.videoList.length < 1) {
+ this.loadVideos();
+ }
// 濡傛灉瑙嗛鎸変笅鏆傚仠鍚庡垏鎹㈤〉闈㈠啀鍥炲埌椤甸潰鏃讹紝鍙畻鏆傚仠鏃堕棿锛堝洜涓烘殏鍋滄椂闂村拰绂诲紑椤甸潰鏃堕棿鏄噸澶嶇殑锛屽彧绠椾竴涓級
if(this.startHidenTime !== 0 && this.currentVideoIsPlaying) {
const duration = Date.now() - this.startHidenTime
@@ -399,6 +416,36 @@
}
},
methods: {
+ // 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
+ async getGoodsSimilarly() {
+ if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
+ const video = this.videoList[this.currentIndex];
+ if (video.goodsList && video.goodsList.length > 0) {
+ this.goodsSimilarlyQuery.goodsIds = video.goodsList.map(goods => goods.goodsId);
+ this.goodsSimilarlyQuery.currentVideoId = video.id;
+ if (this.similarlyVideoList.length < 1) {
+ this.similarlyVideoList.push(video); // 纭繚鍘熻棰戞槸妯悜瑙嗛鐨勭涓�涓厓绱�
+ }
+ this.similarlyLoading = true;
+ return getGoodsSimilarlyVideos(this.goodsSimilarlyQuery).then(res => {
+
+ this.similarlyVideoList = [
+ ...this.similarlyVideoList,
+ ...res.data.data.filter(
+ (newItem) => !this.similarlyVideoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+
+ this.similarlyLoading = false;
+ if(res.data.data.length < this.goodsSimilarlyQuery.pageSize) {
+ this.similarlyNomore = true;
+ return;
+ }
+ this.goodsSimilarlyQuery.pageNumber++;
+ })
+ }
+ },
+ // 璺宠浆鍒版悳绱㈤〉
jumpToSearch() {
uni.navigateTo({
url: '/pages/video/video-search'
@@ -467,6 +514,7 @@
},
// 璺宠浆涓汉涓婚〉
jumpToHomePage(authorId) {
+ console.log("浣滆�卛d", authorId);
uni.navigateTo({
url: "/pages/video/home-page?authorId=" + authorId
})
@@ -710,16 +758,23 @@
this.loading = true;
getRecommendVideos(this.videoQuery).then(res => {
- console.log(res, "瑙嗛鏁版嵁");
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
if (this.videoQuery.pageNumber === 1) {
- this.videoList = res.data.data;
+ this.videoList = data;
} else {
this.videoList = [
...this.videoList,
- ...res.data.data.filter(
+ ...data.filter(
(newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
),
];
+
}
this.loading = false;
if(res.data.data.length < this.videoQuery.pageSize) {
@@ -757,10 +812,28 @@
// 鎾斁褰撳墠瑙嗛
const videoContext1 = uni.createVideoContext(`video${this.currentIndex}`, this);
videoContext1.play()
+
+ // 涓嬫粦鏃讹紝闇�瑕佸皢涓婁竴涓棰戦噸缃负鍘熷瑙嗛(濡傛灉妯悜婊戝姩浜嗙浉鍏宠棰�)
+ if (this.similaryVideoIndex !== 0) {
+ this.videoList[oldIndex] = this.similarlyVideoList[0]
+ }
+ this.similarlyVideoList = [];
+ this.similaryVideoIndex = 0;
+ this.similarlyNomore = false;
+ this.similarlyLoading = false;
+ this.goodsSimilarlyQuery = {
+ pageNumber: 1,
+ pageSize: 6,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ }
+
// 濡傛灉鍓╀綑瑙嗛涓嶈冻锛岃Е鍙戣姹傝幏鍙栨洿澶氳棰�
if (this.videoList.length - 1 < this.currentIndex + this.videoLiveOffset) {
this.loadVideos()
}
+
},
// 寮�濮嬭Е鎽�
@@ -775,7 +848,7 @@
this.touchXY.endY = e.touches[0].pageY
},
// 缁撴潫瑙︽懜
- handleSwiperEnd(item) {
+ async handleSwiperEnd(item) {
// 闃叉婊戝姩婊氬姩鏉′篃瑙﹀彂璺宠浆
if (this.showProcess) {
return
@@ -787,11 +860,37 @@
if (Math.abs(diffX) > Math.abs(diffY)) {
if (diffX > 0) {
console.log('鍙虫粦')
- if (item.goodsList && item.goodsList.length > 0) {
+ if (this.similaryVideoIndex !== 0) {
+ // 濡傛灉婊戝姩浜嗘í鍚戣棰戯紝閭d箞鍙虫粦灏卞仛瑙嗛鍒囨崲鑰屼笉鏄烦杞晢鍝侀〉
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.max(this.similaryVideoIndex - 1, 0);
+ if (this.similaryVideoIndex < oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ // this.videoList[this.currentIndex] = video
+ }
+ }
+ else if (item.goodsList && item.goodsList.length > 0) {
this.jumpToPay(item.id)
}
} else {
console.log('宸︽粦')
+ if (this.similarlyVideoList.length < 1 || this.similarlyVideoList.length - this.similaryVideoIndex - 1 <= 3) {
+ // 鐩稿叧瑙嗛涓虹┖鎴栬�呭墿浣欒棰戜笉瓒筹紝瑙﹀彂鍔犺浇鐩稿叧瑙嗛
+ await this.getGoodsSimilarly()
+ }
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.min(this.similaryVideoIndex + 1, this.similarlyVideoList.length - 1);
+ if (this.similaryVideoIndex > oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ }
}
}
// 閲嶇疆鍧愭爣
@@ -1022,7 +1121,7 @@
}
.video-info {
- width: 70%;
+ width: 100%;
position: absolute;
bottom: 20px;
left: 20px;
diff --git a/pages/tabbar/user/my.vue b/pages/tabbar/user/my.vue
index a86a497..b1327ef 100644
--- a/pages/tabbar/user/my.vue
+++ b/pages/tabbar/user/my.vue
@@ -6,7 +6,8 @@
</view>
<view class="header" @click="userDetail">
<view class="head-1">
- <image :src="userInfo.face || userImage"></image>
+ <image v-if="userInfo.face" :src="endpoint + '/' + userInfo.face"></image>
+ <image v-else :src="userImage"></image>
</view>
<view class="head-2" v-if="userInfo.id">
<view class="user-name">{{ userInfo.nickName }}</view>
@@ -68,24 +69,67 @@
</view>
</view>
</div>
+
+ <!-- 瑙嗛鐩稿叧锛� -->
+ <div class="pointBox box" style="margin-top: 20rpx;">
+ <view class="order">
+ <view class="order-item" @click="jumpToVideoHome()">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>瑙嗛涓婚〉</view>
+ </view>
+ <view class="order-item" @click="navigateTo('/pages/mine/myAttention')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鍏虫敞鍒楄〃</view>
+ </view>
+ <view class="order-item" @click="navigateTo('/pages/mine/myCollect/myCollect')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鏀惰棌鍒楄〃</view>
+ </view>
+ <view class="order-item" @click="navigateTo('/pages/mine/activity/myActivity')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>鎴戠殑娲诲姩</view>
+ </view>
+ <view class="order-item" @click="navigateTo('/pages/mine/myTracks')">
+ <view>
+ <text class="iconfont"></text>
+ </view>
+ <view>娴忚璁板綍</view>
+ </view>
+ </view>
+ </div>
+
<!-- 甯哥敤宸ュ叿 -->
-
- <tool />
+ <view class="pointBox box" style="margin-top: 20rpx;">
+ <tool />
+ </view>
+
+
<custom-tabbar bgColor="#ffffff" selected="my"></custom-tabbar>
</view>
</template>
<script>
import '@/components/uview-components/uview-ui';
import tool from "@/pages/tabbar/user/utils/tool.vue";
+import { getSTSToken } from "@/api/common.js";
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
import { getUserWallet } from "@/api/members";
import configs from '@/config/config'
+import storage from '@/utils/storage.js'
export default {
components: {
tool
},
data() {
return {
+ endpoint: '',
configs,
userImage:configs.defaultUserPhoto,
coverTransform: "translateY(0px)",
@@ -97,7 +141,9 @@
walletNum: "",
};
},
- onLoad() { },
+ onLoad() {
+ this.initCOS()
+ },
onShow() {
this.userInfo = this.$options.filters.isLogin() || {};
if (this.$options.filters.isLogin("auth")) {
@@ -123,6 +169,19 @@
mounted() { },
methods: {
+ // 鍒濆鍖栬吘璁簯cos瀹㈡埛绔�
+ initCOS() {
+ // 璋冪敤鍚庣鑾峰彇sts涓存椂璁块棶鍑瘉
+ getSTSToken().then(res => {
+ this.endpoint = res.data.data.endpoint
+ })
+ },
+ // 璺宠浆瑙嗛涓婚〉
+ jumpToVideoHome() {
+ uni.navigateTo({
+ url: '/pages/video/home-page?authorId=' + storage.getUserInfo().id
+ });
+ },
/**
* 缁熶竴璺宠浆鎺ュ彛,鎷︽埅鏈櫥褰曡矾鐢�
* navigator鏍囩鐜板湪榛樿娌℃湁杞満鍔ㄧ敾锛屾墍浠ョ敤view
@@ -171,7 +230,7 @@
.header {
max-width: 100%;
padding: calc(50rpx + var(--status-bar-height)) 30rpx 0 6%;
- height: calc(var(--status-bar-height) + 360rpx);
+ height: calc(360rpx);
background-size: cover;
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue
index df8a916..b1c458b 100644
--- a/pages/tabbar/user/utils/tool.vue
+++ b/pages/tabbar/user/utils/tool.vue
@@ -10,10 +10,10 @@
<view>鍦板潃绠$悊</view>
</view>
- <view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
+<!-- <view class="interact-item" @click="navigateTo('/pages/mine/myTracks')">
<image src="/static/mine/logistics.png" mode=""></image>
<view>鎴戠殑瓒宠抗</view>
- </view>
+ </view> -->
<view class="interact-item" @click="navigateTo('/pages/order/evaluate/myEvaluate')">
<image src="/static/mine/feedback.png" mode=""></image>
@@ -25,10 +25,10 @@
</view> -->
- <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
+<!-- <view class="interact-item" @click="navigateTo('/pages/mine/myCollect')">
<image src="/static/mine/myfavorite.png" mode=""></image>
<view>鎴戠殑鍏虫敞</view>
- </view>
+ </view> -->
@@ -47,20 +47,21 @@
<view>鎴戠殑鏀惰棌</view>
</view> -->
- <view class="interact-item" @click="navigateTo('/pages/mine/activity/myActivity')">
+<!-- <view class="interact-item" @click="navigateTo('/pages/mine/activity/myActivity')">
<image src="/static/mine/shensu.png" mode=""></image>
<view>鎴戠殑娲诲姩</view>
+ </view> -->
</view>
-
+
<view class="interact-item" @click="navigateTo('/pages/mine/activity/applayActivityList')">
<image src="/static/mine/shensu.png" mode=""></image>
<view>鐢宠娲诲姩</view>
</view>
- <view class="interact-item" @click="navigateTo('/pages/mine/myCollect/myCollect')">
+<!-- <view class="interact-item" @click="navigateTo('/pages/mine/myCollect/myCollect')">
<image src="/static/mine/shensu.png" mode=""></image>
<view>鎴戠殑鏀惰棌</view>
- </view>
+ </view> -->
<view class="interact-item" v-if="isStoreManger" @click="navigateTo('/pages/userPermissions/userPermissions')">
<image src="/static/mine/shensu.png" mode=""></image>
@@ -131,7 +132,7 @@
<image src="/static/mine/setting.png" mode=""></image>
<view>鍟嗗搧绠$悊</view>
</view>
- <view class="interact-item" @click="navigateTo('/pages/goods-manager/goodsList/goodsList')">
+ <view class="interact-item" @click="navigateTo('/pages/supplier/suppler-order/suppler-order')">
<image src="/static/mine/order.png" mode=""></image>
<view>鍟嗘埛璁㈠崟绠$悊</view>
</view>
diff --git a/pages/tabbar/video/video.vue b/pages/tabbar/video/video.vue
index c70a040..c601704 100644
--- a/pages/tabbar/video/video.vue
+++ b/pages/tabbar/video/video.vue
@@ -208,7 +208,7 @@
import '@/components/uview-components/uview-ui';
import MyTag from '@/components/my-tag.vue'
-import { getSTSToken, getFilePreviewUrl } from "@/api/common.js";
+import { getSTSToken } from "@/api/common.js";
import { publish } from "@/api/video.js";
import { getRecommendTag3 } from "@/api/video-tag.js";
import { getFileKey } from "@/utils/file.js";
@@ -488,7 +488,7 @@
let fileName = tmpImg.substring(tmpImg.lastIndexOf('/') + 1);
// 澶勭悊瀹夊崜鍙兘鐨刄RI缂栫爜
if(fileName.indexOf('%') > -1) {
- fileName = decodeURIComponent(fileName);
+ fileName = decodeURIComponent(fileName);
}
const fileKey = getFileKey(fileName);
this.cosClient.uploadFile({
diff --git a/pages/userPermissions/userPermissions.vue b/pages/userPermissions/userPermissions.vue
index 7a4c50c..5f4d1b6 100644
--- a/pages/userPermissions/userPermissions.vue
+++ b/pages/userPermissions/userPermissions.vue
@@ -5,7 +5,7 @@
<text class="title">鐢ㄦ埛鍒楄〃</text>
</view>
<view>
- <button class="add-btn" @click="navigateToAdd()" :disabled="!isShopkeeper">鏂板鐢ㄦ埛</button>
+ <button class="add-btn" @click="navigateToAdd()">鏂板鐢ㄦ埛</button>
</view>
<!-- 鎼滅储妗� -->
<view class="search-box">
diff --git a/pages/video/home-page.vue b/pages/video/home-page.vue
index b9a7b49..4188a83 100644
--- a/pages/video/home-page.vue
+++ b/pages/video/home-page.vue
@@ -222,22 +222,25 @@
}
},
onShow() {
- this.getAuthorInfo();
- if (this.currentTab === 'works') {
- this.videoQuery.pageNumber = 1
- this.nomoreVideo = false
- this.getAuthorVideoPage();
- } else if (this.currentTab === 'collect') {
- this.collectVideoQuery.pageNumber = 1
- this.nomoreCollectVideo = false
- this.getAuthorCollectVideoPage()
- } else if (this.currentTab === 'likes') {
- this.likeVideoQuery.pageNumber = 1
- this.nomoreLikeVideo = false
- this.getAuthorLikeVideoPage()
+ if (this.authorId) {
+ this.getAuthorInfo();
+ if (this.currentTab === 'works') {
+ this.videoQuery.pageNumber = 1
+ this.nomoreVideo = false
+ this.getAuthorVideoPage();
+ } else if (this.currentTab === 'collect') {
+ this.collectVideoQuery.pageNumber = 1
+ this.nomoreCollectVideo = false
+ this.getAuthorCollectVideoPage()
+ } else if (this.currentTab === 'likes') {
+ this.likeVideoQuery.pageNumber = 1
+ this.nomoreLikeVideo = false
+ this.getAuthorLikeVideoPage()
+ }
}
},
onLoad(option) {
+ console.log("鏀跺埌鍙傛暟", option);
this.authorId = option.authorId;
this.getAuthorInfo();
this.getAuthorVideoPage();
diff --git a/pages/video/video-edit.vue b/pages/video/video-edit.vue
index 66fcb5d..1cbdbaa 100644
--- a/pages/video/video-edit.vue
+++ b/pages/video/video-edit.vue
@@ -666,7 +666,10 @@
this.loading = true;
this.formData.fileInfo = this.videoInfo;
this.formData["goodsList"] = this.selectedGoodsList.map(item => {return {goodsId: item.goodsId, goodsSkuId: item.id, goodsNum: item.goodsNum}});
- updateVideo(this.formData).then(res => {
+ if (this.formData.videoContentType === 'img') {
+ this.formData.videoImgs = JSON.parse(this.formData.videoImgs)
+ }
+ updateVideo(this.formData).then(res => {
uni.showToast({
title: '瑙嗛宸叉彁浜ゅ鏍竳',
icon: 'success'
diff --git a/pages/video/video-play.vue b/pages/video/video-play.vue
index cb2bb48..2f204fa 100644
--- a/pages/video/video-play.vue
+++ b/pages/video/video-play.vue
@@ -130,9 +130,9 @@
<!-- 鍙充晶浜掑姩鎸夐挳 -->
<view class="action-buttons">
<view class="avatar-container">
- <image class="avatar" @click="jumpToHomePage(item.authorId)" :src="item.authorAvatar" mode="aspectFill"></image>
+ <image class="avatar" @click="jumpToHomePage(item.authorId)" @touchend.stop :src="item.authorAvatar" mode="aspectFill"></image>
<!-- 鍏虫敞鍥炬爣 - 浣跨敤缁濆瀹氫綅 -->
- <view v-if="!item.subscribeThisAuthor" class="follow-icon" @click="subscribeAuth(index, item.authorId)">
+ <view v-if="!item.subscribeThisAuthor" class="follow-icon" @touchend.stop @click="subscribeAuth(index, item.authorId)">
<text class="iconfont"></text>
</view>
</view>
@@ -252,6 +252,7 @@
thubmsUpComment,
cancelThubmsUpComment,
changeThumbsUp,
+ getGoodsSimilarlyVideos
} from "@/api/video.js";
import { changeCollect } from "@/api/collect.js";
import { saveShare } from "@/api/share.js";
@@ -334,6 +335,17 @@
videoFrom: '',
keyword: ''
},
+ goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
+ pageNumber: 1,
+ pageSize: 10,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ },
+ similarlyVideoList: [], // 鐩镐技瑙嗛
+ similarlyNomore: false, // 鏄惁杩樻湁鏇村鐩镐技瑙嗛
+ similaryVideoIndex: 0, // 鐩镐技瑙嗛鐨勬挱鏀句綅缃�
+ similarlyLoading: false, // 鐩镐技瑙嗛鍔犺浇
marginBottom: 0, // 搴曢儴瀹夊叏鍖哄煙
windowHeight: 0 // 鍙娇鐢ㄥ睆骞曢珮搴�
}
@@ -411,6 +423,35 @@
}
},
methods: {
+ // 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
+ async getGoodsSimilarly() {
+ if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
+ const video = this.videoList[this.currentIndex];
+ if (video.goodsList && video.goodsList.length > 0) {
+ this.goodsSimilarlyQuery.goodsIds = video.goodsList.map(goods => goods.goodsId);
+ this.goodsSimilarlyQuery.currentVideoId = video.id;
+ if (this.similarlyVideoList.length < 1) {
+ this.similarlyVideoList.push(video); // 纭繚鍘熻棰戞槸妯悜瑙嗛鐨勭涓�涓厓绱�
+ }
+ this.similarlyLoading = true;
+ return getGoodsSimilarlyVideos(this.goodsSimilarlyQuery).then(res => {
+
+ this.similarlyVideoList = [
+ ...this.similarlyVideoList,
+ ...res.data.data.filter(
+ (newItem) => !this.similarlyVideoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+
+ this.similarlyLoading = false;
+ if(res.data.data.length < this.goodsSimilarlyQuery.pageSize) {
+ this.similarlyNomore = true;
+ return;
+ }
+ this.goodsSimilarlyQuery.pageNumber++;
+ })
+ }
+ },
// 鐐瑰嚮鍟嗗搧璺宠浆
jumpToPay(videoId) {
uni.navigateTo({
@@ -680,18 +721,25 @@
this.loading = true;
getRecommendVideos(this.videoQuery).then(res => {
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
if (this.videoQuery.pageNumber === 1) {
- this.videoList = res.data.data;
+ this.videoList = data;
} else {
this.videoList = [
...this.videoList,
- ...res.data.data.filter(
+ ...data.filter(
(newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
),
];
}
this.loading = false;
- if(res.data.data.length < this.videoQuery.pageSize) {
+ if(data.length < this.videoQuery.pageSize) {
this.videoNoMore = true;
return;
}
@@ -725,6 +773,23 @@
// 鎾斁褰撳墠瑙嗛
const videoContext1 = uni.createVideoContext(`video${this.currentIndex}`, this);
videoContext1.play()
+
+ // 涓嬫粦鏃讹紝闇�瑕佸皢涓婁竴涓棰戦噸缃负鍘熷瑙嗛(濡傛灉妯悜婊戝姩浜嗙浉鍏宠棰�)
+ if (this.similaryVideoIndex !== 0) {
+ this.videoList[oldIndex] = this.similarlyVideoList[0]
+ }
+ this.similarlyVideoList = [];
+ this.similaryVideoIndex = 0;
+ this.similarlyNomore = false;
+ this.similarlyLoading = false;
+ this.goodsSimilarlyQuery = {
+ pageNumber: 1,
+ pageSize: 6,
+ videoFrom: 'goodsSimilarly',
+ goodsIds: [],
+ currentVideoId: ''
+ }
+
// 濡傛灉鍓╀綑瑙嗛涓嶈冻锛岃Е鍙戣姹傝幏鍙栨洿澶氳棰�
if (this.videoList.length - 1 < this.currentIndex + this.videoLiveOffset) {
this.loadVideos()
@@ -742,7 +807,7 @@
this.touchXY.endY = e.touches[0].pageY
},
// 缁撴潫瑙︽懜
- handleSwiperEnd(item) {
+ async handleSwiperEnd(item) {
// 闃叉婊戝姩婊氬姩鏉′篃瑙﹀彂璺宠浆
if (this.showProcess) {
return
@@ -755,11 +820,37 @@
if (Math.abs(diffX) > Math.abs(diffY)) {
if (diffX > 0) {
console.log('鍙虫粦')
- if (item.goodsList && item.goodsList.length > 0) {
- this.jumpToPay(item.id)
- }
+ if (this.similaryVideoIndex !== 0) {
+ // 濡傛灉婊戝姩浜嗘í鍚戣棰戯紝閭d箞鍙虫粦灏卞仛瑙嗛鍒囨崲鑰屼笉鏄烦杞晢鍝侀〉
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.max(this.similaryVideoIndex - 1, 0);
+ if (this.similaryVideoIndex < oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ // this.videoList[this.currentIndex] = video
+ }
+ }
+ else if (item.goodsList && item.goodsList.length > 0) {
+ this.jumpToPay(item.id)
+ }
} else {
console.log('宸︽粦')
+ if (this.similarlyVideoList.length < 1 || this.similarlyVideoList.length - this.similaryVideoIndex - 1 <= 3) {
+ // 鐩稿叧瑙嗛涓虹┖鎴栬�呭墿浣欒棰戜笉瓒筹紝瑙﹀彂鍔犺浇鐩稿叧瑙嗛
+ await this.getGoodsSimilarly()
+ }
+ // 鍒囨崲涓嬩竴涓棰�
+ const oldIndex = this.similaryVideoIndex;
+ this.similaryVideoIndex = Math.min(this.similaryVideoIndex + 1, this.similarlyVideoList.length - 1);
+ if (this.similaryVideoIndex > oldIndex) {
+ // 鎶婄珫鍚戣棰戠殑褰撳墠鎾斁浣嶇疆鏇挎崲涓烘í鍚戣棰戠殑褰撳墠绱㈠紩鍏冪礌
+ const video = this.similarlyVideoList[this.similaryVideoIndex];
+ video["updateKey"] = video.id + this.similaryVideoIndex
+ this.videoList.splice(this.currentIndex, 1, video);
+ }
}
}
// 閲嶇疆鍧愭爣
diff --git a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
index 61baab5..a520e4a 100644
--- a/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
+++ b/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
@@ -90,15 +90,13 @@
watchTimer: null,
drawerWidth: 220,
drawerHeight: null,
- drawerTop:0
}
},
created() {
// #ifndef APP-NVUE
this.drawerWidth = this.width
this.drawerHeight = this.height
- this.drawerTop = this.drawerTop
- console.log("鎵ц浜�",this.drawerHeight,this.height)
+ console.log("鎵ц浜�",this.width,this.height)
// #endif
this.rightMode = this.mode === 'right'
},
diff --git a/uni_modules/uni-steps/changelog.md b/uni_modules/uni-steps/changelog.md
new file mode 100644
index 0000000..04367d8
--- /dev/null
+++ b/uni_modules/uni-steps/changelog.md
@@ -0,0 +1,18 @@
+## 1.1.2锛�2024-03-28锛�
+- 淇 uni-steps涓虹珫鎺掑垪鏃讹紝鏂囨湰闀垮害杩囬暱寮曡捣鐐归敊涔辩殑bug
+## 1.1.1锛�2021-11-22锛�
+- 淇 vue3涓煇浜泂css鍙橀噺鏃犳硶鎵惧埌鐨勯棶棰�
+## 1.1.0锛�2021-11-19锛�
+- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-steps](https://uniapp.dcloud.io/component/uniui/uni-steps)
+## 1.0.8锛�2021-05-12锛�
+- 鏂板 椤圭洰绀轰緥鍦板潃
+## 1.0.7锛�2021-05-06锛�
+- 淇 uni-steps 妯悜甯冨眬鏃讹紝澶氳鏂囧瓧楂樺害涓嶅悎鐞嗙殑 bug
+## 1.0.6锛�2021-04-21锛�
+- 浼樺寲 娣诲姞渚濊禆 uni-icons, 瀵煎叆鍚庤嚜鍔ㄤ笅杞戒緷璧�
+## 1.0.5锛�2021-02-05锛�
+- 浼樺寲 缁勪欢寮曠敤鍏崇郴锛岄�氳繃uni_modules寮曠敤缁勪欢
+
+## 1.0.4锛�2021-02-05锛�
+- 璋冩暣涓簎ni_modules鐩綍瑙勮寖
diff --git a/uni_modules/uni-steps/components/uni-steps/uni-steps.vue b/uni_modules/uni-steps/components/uni-steps/uni-steps.vue
new file mode 100644
index 0000000..81017fc
--- /dev/null
+++ b/uni_modules/uni-steps/components/uni-steps/uni-steps.vue
@@ -0,0 +1,280 @@
+<template>
+ <view class="uni-steps">
+ <view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']">
+ <view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
+ <view v-for="(item,index) in options" :key="index"
+ :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
+ <text :style="{color:index === active?activeColor:deactiveColor}"
+ :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
+ <text :style="{color: deactiveColor}"
+ :class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
+ </view>
+ </view>
+ <view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
+ <view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']"
+ v-for="(item,index) in options" :key="index" :style="{height: direction === 'column'?heightArr[index]+'px':'14px'}">
+ <view
+ :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
+ :style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
+ </view>
+ <view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
+ v-if="index === active">
+ <uni-icons :color="activeColor" :type="activeIcon" size="14" />
+ </view>
+ <view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
+ :style="{backgroundColor:index<active?activeColor:deactiveColor}" />
+ <view
+ :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
+ :style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
+ </view>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ /**
+ * Steps 姝ラ鏉�
+ * @description 璇勫垎缁勪欢
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=34
+ * @property {Number} active 褰撳墠姝ラ
+ * @property {String} direction = [row|column] 褰撳墠姝ラ
+ * @value row 妯悜
+ * @value column 绾靛悜
+ * @property {String} activeColor 閫変腑鐘舵�佺殑棰滆壊
+ * @property {Array} options 鏁版嵁婧愶紝鏍煎紡涓猴細[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
+ */
+
+ export default {
+ name: 'UniSteps',
+ props: {
+ direction: {
+ // 鎺掑垪鏂瑰悜 row column
+ type: String,
+ default: 'row'
+ },
+ activeColor: {
+ // 婵�娲荤姸鎬侀鑹�
+ type: String,
+ default: '#2979FF'
+ },
+ deactiveColor: {
+ // 鏈縺娲荤姸鎬侀鑹�
+ type: String,
+ default: '#B7BDC6'
+ },
+ active: {
+ // 褰撳墠姝ラ
+ type: Number,
+ default: 0
+ },
+ activeIcon: {
+ // 褰撳墠姝ラ
+ type: String,
+ default: 'checkbox-filled'
+ },
+ options: {
+ type: Array,
+ default () {
+ return []
+ }
+ } // 鏁版嵁
+ },
+ data() {
+ return {
+ heightArr: [],
+ }
+ },
+ mounted() {
+ //鏍规嵁鍐呭璁剧疆姝ラ鏉$殑闀垮害
+ if (this.direction === 'column') {
+ let that = this;
+ //鍙兘鐢ㄧ被閫夋嫨鍣紝鐢╥d閫夋嫨鍣ㄦ墍鑾峰彇鐨勫厓绱犱俊鎭笉鍑嗙‘
+ uni.createSelectorQuery().in(this).selectAll('.uni-steps__column-text').boundingClientRect(data => {
+ that.heightArr = data.map(item => item.height + 1);
+ }).exec()
+ }
+ },
+ }
+</script>
+
+<style lang="scss">
+ $uni-primary: #2979ff !default;
+ $uni-border-color: #EDEDED;
+
+ .uni-steps {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ width: 100%;
+ /* #endif */
+ /* #ifdef APP-NVUE */
+ flex: 1;
+ /* #endif */
+ flex-direction: column;
+ }
+
+ .uni-steps__row {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ }
+
+ .uni-steps__column {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row-reverse;
+ }
+
+ .uni-steps__row-text-container {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ align-items: flex-end;
+ margin-bottom: 8px;
+ }
+
+ .uni-steps__column-text-container {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ flex: 1;
+ }
+
+ .uni-steps__row-text {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ flex: 1;
+ flex-direction: column;
+ }
+
+ .uni-steps__column-text {
+ padding: 6px 0px;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-color: $uni-border-color;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ }
+
+ .uni-steps__row-title {
+ font-size: 14px;
+ line-height: 16px;
+ text-align: center;
+ }
+
+ .uni-steps__column-title {
+ font-size: 14px;
+ text-align: left;
+ line-height: 18px;
+ }
+
+ .uni-steps__row-desc {
+ font-size: 12px;
+ line-height: 14px;
+ text-align: center;
+ }
+
+ .uni-steps__column-desc {
+ font-size: 12px;
+ text-align: left;
+ line-height: 18px;
+ }
+
+ .uni-steps__row-container {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+ }
+
+ .uni-steps__column-container {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ width: 30px;
+ flex-direction: column;
+ }
+
+ .uni-steps__row-line-item {
+ /* #ifndef APP-NVUE */
+ display: inline-flex;
+ /* #endif */
+ flex-direction: row;
+ flex: 1;
+ height: 14px;
+ line-height: 14px;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .uni-steps__column-line-item {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .uni-steps__row-line {
+ flex: 1;
+ height: 1px;
+ background-color: #B7BDC6;
+ }
+
+ .uni-steps__column-line {
+ width: 1px;
+ background-color: #B7BDC6;
+ }
+
+ .uni-steps__row-line--after {
+ transform: translateX(1px);
+ }
+
+ .uni-steps__column-line--after {
+ flex: 1;
+ transform: translate(0px, 1px);
+ }
+
+ .uni-steps__row-line--before {
+ transform: translateX(-1px);
+ }
+
+ .uni-steps__column-line--before {
+ height: 6px;
+ transform: translate(0px, -13px);
+ }
+
+ .uni-steps__row-circle {
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+ background-color: #B7BDC6;
+ margin: 0px 3px;
+ }
+
+ .uni-steps__column-circle {
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+ background-color: #B7BDC6;
+ margin: 4px 0px 5px 0px;
+ }
+
+ .uni-steps__row-check {
+ margin: 0px 6px;
+ }
+
+ .uni-steps__column-check {
+ height: 14px;
+ line-height: 14px;
+ margin: 2px 0px;
+ }
+</style>
diff --git a/uni_modules/uni-steps/package.json b/uni_modules/uni-steps/package.json
new file mode 100644
index 0000000..4145ce9
--- /dev/null
+++ b/uni_modules/uni-steps/package.json
@@ -0,0 +1,87 @@
+{
+ "id": "uni-steps",
+ "displayName": "uni-steps 姝ラ鏉�",
+ "version": "1.1.2",
+ "description": "姝ラ鏉$粍浠讹紝鎻愪緵妯悜鍜岀旱鍚戜袱绉嶅竷灞�鏍煎紡銆�",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "姝ラ鏉�",
+ "鏃堕棿杞�"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+"dcloudext": {
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "鏃�",
+ "data": "鏃�",
+ "permissions": "鏃�"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
+ },
+ "uni_modules": {
+ "dependencies": [
+ "uni-scss",
+ "uni-icons"
+ ],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y",
+ "alipay": "n"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "y"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "寰俊娴忚鍣�(Android)": "y",
+ "QQ娴忚鍣�(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "灏忕▼搴�": {
+ "寰俊": "y",
+ "闃块噷": "y",
+ "鐧惧害": "y",
+ "瀛楄妭璺冲姩": "y",
+ "QQ": "y"
+ },
+ "蹇簲鐢�": {
+ "鍗庝负": "u",
+ "鑱旂洘": "u"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/uni-steps/readme.md b/uni_modules/uni-steps/readme.md
new file mode 100644
index 0000000..da7a4bf
--- /dev/null
+++ b/uni_modules/uni-steps/readme.md
@@ -0,0 +1,13 @@
+
+
+## Steps 姝ラ鏉�
+> **缁勪欢鍚嶏細uni-steps**
+> 浠g爜鍧楋細 `uSteps`
+
+
+姝ラ鏉★紝甯哥敤浜庢樉绀鸿繘搴�
+
+### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-steps)
+#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839
+
+
diff --git a/uni_modules/uni-table/changelog.md b/uni_modules/uni-table/changelog.md
new file mode 100644
index 0000000..811250e
--- /dev/null
+++ b/uni_modules/uni-table/changelog.md
@@ -0,0 +1,35 @@
+## 1.2.9锛�2025-04-14锛�
+- 淇锛� 涓嬫媺绛涢�変腑 toISOString() 寮曞彂鐨勬椂鍖洪棶棰�
+## 1.2.8锛�2024-10-15锛�
+- 淇 杩愯鍒版姈闊冲皬绋嬪簭涓婂嚭鐜扮殑闂
+## 1.2.7锛�2024-10-15锛�
+- 淇 寰俊灏忕▼搴忎腑鐨刧etSystemInfo璀﹀憡
+## 1.2.4锛�2023-12-19锛�
+- 淇 uni-tr鍙湁涓�鍒楁椂minWidth璁$畻閿欒锛屽垪鍙樺寲瀹炴椂璁$畻鏇存柊
+## 1.2.3锛�2023-03-28锛�
+- 淇 鍦╲ue3妯″紡涓嬪彲鑳戒細鍑虹幇閿欒鐨勯棶棰�
+## 1.2.2锛�2022-11-29锛�
+- 浼樺寲 涓婚鏍峰紡
+## 1.2.1锛�2022-06-06锛�
+- 淇 寰俊灏忕▼搴忓瓨鍦ㄦ棤浣跨敤缁勪欢鐨勯棶棰�
+## 1.2.0锛�2021-11-19锛�
+- 浼樺寲 缁勪欢UI锛屽苟鎻愪緵璁捐璧勬簮锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 鏂囨。杩佺Щ锛岃瑙�:[https://uniapp.dcloud.io/component/uniui/uni-table](https://uniapp.dcloud.io/component/uniui/uni-table)
+## 1.1.0锛�2021-07-30锛�
+- 缁勪欢鍏煎 vue3锛屽浣曞垱寤簐ue3椤圭洰锛岃瑙� [uni-app 椤圭洰鏀寔 vue3 浠嬬粛](https://ask.dcloud.net.cn/article/37834)
+## 1.0.7锛�2021-07-08锛�
+- 鏂板 uni-th 鏀寔 date 鏃ユ湡绛涢�夎寖鍥�
+## 1.0.6锛�2021-07-05锛�
+- 鏂板 uni-th 鏀寔 range 绛涢�夎寖鍥�
+## 1.0.5锛�2021-06-28锛�
+- 鏂板 uni-th 绛涢�夊姛鑳�
+## 1.0.4锛�2021-05-12锛�
+- 鏂板 绀轰緥鍦板潃
+- 淇 绀轰緥椤圭洰缂哄皯缁勪欢鐨凚ug
+## 1.0.3锛�2021-04-16锛�
+- 鏂板 sortable 灞炴�э紝鏄惁寮�鍚崟鍒楁帓搴�
+- 浼樺寲 琛ㄦ牸澶氶�夐�昏緫
+## 1.0.2锛�2021-03-22锛�
+- uni-tr 娣诲姞 disabled 灞炴�э紝鐢ㄤ簬 type=selection 鏃讹紝璁剧疆鏌愯鏄惁鍙敱鍏ㄩ�夋寜閽帶鍒�
+## 1.0.1锛�2021-02-05锛�
+- 璋冩暣涓簎ni_modules鐩綍瑙勮寖
diff --git a/uni_modules/uni-table/components/uni-table/uni-table.vue b/uni_modules/uni-table/components/uni-table/uni-table.vue
new file mode 100644
index 0000000..3ab0496
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-table/uni-table.vue
@@ -0,0 +1,460 @@
+<template>
+ <view class="uni-table-scroll" :class="{ 'table--border': border, 'border-none': !noData }">
+ <!-- #ifdef H5 -->
+ <table class="uni-table" border="0" cellpadding="0" cellspacing="0" :class="{ 'table--stripe': stripe }" :style="{ 'min-width': minWidth + 'px' }">
+ <slot></slot>
+ <tr v-if="noData" class="uni-table-loading">
+ <td class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</td>
+ </tr>
+ <view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
+ </table>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <view class="uni-table" :style="{ 'min-width': minWidth + 'px' }" :class="{ 'table--stripe': stripe }">
+ <slot></slot>
+ <view v-if="noData" class="uni-table-loading">
+ <view class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</view>
+ </view>
+ <view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
+ </view>
+ <!-- #endif -->
+ </view>
+</template>
+
+<script>
+/**
+ * Table 琛ㄦ牸
+ * @description 鐢ㄤ簬灞曠ず澶氭潯缁撴瀯绫讳技鐨勬暟鎹�
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3270
+ * @property {Boolean} border 鏄惁甯︽湁绾靛悜杈规
+ * @property {Boolean} stripe 鏄惁鏄剧ず鏂戦┈绾�
+ * @property {Boolean} type 鏄惁寮�鍚閫�
+ * @property {String} emptyText 绌烘暟鎹椂鏄剧ず鐨勬枃鏈唴瀹�
+ * @property {Boolean} loading 鏄剧ず鍔犺浇涓�
+ * @event {Function} selection-change 寮�鍚閫夋椂锛屽綋閫夋嫨椤瑰彂鐢熷彉鍖栨椂浼氳Е鍙戣浜嬩欢
+ */
+export default {
+ name: 'uniTable',
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ emits:['selection-change'],
+ props: {
+ data: {
+ type: Array,
+ default() {
+ return []
+ }
+ },
+ // 鏄惁鏈夌珫绾�
+ border: {
+ type: Boolean,
+ default: false
+ },
+ // 鏄惁鏄剧ず鏂戦┈绾�
+ stripe: {
+ type: Boolean,
+ default: false
+ },
+ // 澶氶��
+ type: {
+ type: String,
+ default: ''
+ },
+ // 娌℃湁鏇村鏁版嵁
+ emptyText: {
+ type: String,
+ default: '娌℃湁鏇村鏁版嵁'
+ },
+ loading: {
+ type: Boolean,
+ default: false
+ },
+ rowKey: {
+ type: String,
+ default: ''
+ }
+ },
+ data() {
+ return {
+ noData: true,
+ minWidth: 0,
+ multiTableHeads: []
+ }
+ },
+ watch: {
+ loading(val) {},
+ data(newVal) {
+ let theadChildren = this.theadChildren
+ let rowspan = 1
+ if (this.theadChildren) {
+ rowspan = this.theadChildren.rowspan
+ }
+
+ // this.trChildren.length - rowspan
+ this.noData = false
+ // this.noData = newVal.length === 0
+ }
+ },
+ created() {
+ // 瀹氫箟tr鐨勫疄渚嬫暟缁�
+ this.trChildren = []
+ this.thChildren = []
+ this.theadChildren = null
+ this.backData = []
+ this.backIndexData = []
+ },
+
+ methods: {
+ isNodata() {
+ let theadChildren = this.theadChildren
+ let rowspan = 1
+ if (this.theadChildren) {
+ rowspan = this.theadChildren.rowspan
+ }
+ this.noData = this.trChildren.length - rowspan <= 0
+ },
+ /**
+ * 閫変腑鎵�鏈�
+ */
+ selectionAll() {
+ let startIndex = 1
+ let theadChildren = this.theadChildren
+ if (!this.theadChildren) {
+ theadChildren = this.trChildren[0]
+ } else {
+ startIndex = theadChildren.rowspan - 1
+ }
+ let isHaveData = this.data && this.data.length > 0
+ theadChildren.checked = true
+ theadChildren.indeterminate = false
+ this.trChildren.forEach((item, index) => {
+ if (!item.disabled) {
+ item.checked = true
+ if (isHaveData && item.keyValue) {
+ const row = this.data.find(v => v[this.rowKey] === item.keyValue)
+ if (!this.backData.find(v => v[this.rowKey] === row[this.rowKey])) {
+ this.backData.push(row)
+ }
+ }
+ if (index > (startIndex - 1) && this.backIndexData.indexOf(index - startIndex) === -1) {
+ this.backIndexData.push(index - startIndex)
+ }
+ }
+ })
+ // this.backData = JSON.parse(JSON.stringify(this.data))
+ this.$emit('selection-change', {
+ detail: {
+ value: this.backData,
+ index: this.backIndexData
+ }
+ })
+ },
+ /**
+ * 鐢ㄤ簬澶氶�夎〃鏍硷紝鍒囨崲鏌愪竴琛岀殑閫変腑鐘舵�侊紝濡傛灉浣跨敤浜嗙浜屼釜鍙傛暟锛屽垯鏄缃繖涓�琛岄�変腑涓庡惁锛坰elected 涓� true 鍒欓�変腑锛�
+ */
+ toggleRowSelection(row, selected) {
+ // if (!this.theadChildren) return
+ row = [].concat(row)
+
+ this.trChildren.forEach((item, index) => {
+ // if (item.keyValue) {
+
+ const select = row.findIndex(v => {
+ //
+ if (typeof v === 'number') {
+ return v === index - 1
+ } else {
+ return v[this.rowKey] === item.keyValue
+ }
+ })
+ let ischeck = item.checked
+ if (select !== -1) {
+ if (typeof selected === 'boolean') {
+ item.checked = selected
+ } else {
+ item.checked = !item.checked
+ }
+ if (ischeck !== item.checked) {
+ this.check(item.rowData||item, item.checked, item.rowData?item.keyValue:null, true)
+ }
+ }
+ // }
+ })
+ this.$emit('selection-change', {
+ detail: {
+ value: this.backData,
+ index:this.backIndexData
+ }
+ })
+ },
+
+ /**
+ * 鐢ㄤ簬澶氶�夎〃鏍硷紝娓呯┖鐢ㄦ埛鐨勯�夋嫨
+ */
+ clearSelection() {
+ let theadChildren = this.theadChildren
+ if (!this.theadChildren) {
+ theadChildren = this.trChildren[0]
+ }
+ // if (!this.theadChildren) return
+ theadChildren.checked = false
+ theadChildren.indeterminate = false
+ this.trChildren.forEach(item => {
+ // if (item.keyValue) {
+ item.checked = false
+ // }
+ })
+ this.backData = []
+ this.backIndexData = []
+ this.$emit('selection-change', {
+ detail: {
+ value: [],
+ index: []
+ }
+ })
+ },
+ /**
+ * 鐢ㄤ簬澶氶�夎〃鏍硷紝鍒囨崲鎵�鏈夎鐨勯�変腑鐘舵��
+ */
+ toggleAllSelection() {
+ let list = []
+ let startIndex = 1
+ let theadChildren = this.theadChildren
+ if (!this.theadChildren) {
+ theadChildren = this.trChildren[0]
+ } else {
+ startIndex = theadChildren.rowspan - 1
+ }
+ this.trChildren.forEach((item, index) => {
+ if (!item.disabled) {
+ if (index > (startIndex - 1) ) {
+ list.push(index-startIndex)
+ }
+ }
+ })
+ this.toggleRowSelection(list)
+ },
+
+ /**
+ * 閫変腑\鍙栨秷閫変腑
+ * @param {Object} child
+ * @param {Object} check
+ * @param {Object} rowValue
+ */
+ check(child, check, keyValue, emit) {
+ let theadChildren = this.theadChildren
+ if (!this.theadChildren) {
+ theadChildren = this.trChildren[0]
+ }
+
+
+
+ let childDomIndex = this.trChildren.findIndex((item, index) => child === item)
+ if(childDomIndex < 0){
+ childDomIndex = this.data.findIndex(v=>v[this.rowKey] === keyValue) + 1
+ }
+ const dataLen = this.trChildren.filter(v => !v.disabled && v.keyValue).length
+ if (childDomIndex === 0) {
+ check ? this.selectionAll() : this.clearSelection()
+ return
+ }
+
+ if (check) {
+ if (keyValue) {
+ this.backData.push(child)
+ }
+ this.backIndexData.push(childDomIndex - 1)
+ } else {
+ const index = this.backData.findIndex(v => v[this.rowKey] === keyValue)
+ const idx = this.backIndexData.findIndex(item => item === childDomIndex - 1)
+ if (keyValue) {
+ this.backData.splice(index, 1)
+ }
+ this.backIndexData.splice(idx, 1)
+ }
+
+ const domCheckAll = this.trChildren.find((item, index) => index > 0 && !item.checked && !item.disabled)
+ if (!domCheckAll) {
+ theadChildren.indeterminate = false
+ theadChildren.checked = true
+ } else {
+ theadChildren.indeterminate = true
+ theadChildren.checked = false
+ }
+
+ if (this.backIndexData.length === 0) {
+ theadChildren.indeterminate = false
+ }
+
+ if (!emit) {
+ this.$emit('selection-change', {
+ detail: {
+ value: this.backData,
+ index: this.backIndexData
+ }
+ })
+ }
+ }
+ }
+}
+</script>
+
+<style lang="scss">
+$border-color: #ebeef5;
+
+.uni-table-scroll {
+ width: 100%;
+ /* #ifndef APP-NVUE */
+ overflow-x: auto;
+ /* #endif */
+}
+
+.uni-table {
+ position: relative;
+ width: 100%;
+ border-radius: 5px;
+ // box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.1);
+ background-color: #fff;
+ /* #ifndef APP-NVUE */
+ box-sizing: border-box;
+ display: table;
+ overflow-x: auto;
+ ::v-deep .uni-table-tr:nth-child(n + 2) {
+ &:hover {
+ background-color: #f5f7fa;
+ }
+ }
+ ::v-deep .uni-table-thead {
+ .uni-table-tr {
+ // background-color: #f5f7fa;
+ &:hover {
+ background-color:#fafafa;
+ }
+ }
+ }
+ /* #endif */
+}
+
+.table--border {
+ border: 1px $border-color solid;
+ border-right: none;
+}
+
+.border-none {
+ /* #ifndef APP-NVUE */
+ border-bottom: none;
+ /* #endif */
+}
+
+.table--stripe {
+ /* #ifndef APP-NVUE */
+ ::v-deep .uni-table-tr:nth-child(2n + 3) {
+ background-color: #fafafa;
+ }
+ /* #endif */
+}
+
+/* 琛ㄦ牸鍔犺浇銆佹棤鏁版嵁鏍峰紡 */
+.uni-table-loading {
+ position: relative;
+ /* #ifndef APP-NVUE */
+ display: table-row;
+ /* #endif */
+ height: 50px;
+ line-height: 50px;
+ overflow: hidden;
+ box-sizing: border-box;
+}
+.empty-border {
+ border-right: 1px $border-color solid;
+}
+.uni-table-text {
+ position: absolute;
+ right: 0;
+ left: 0;
+ text-align: center;
+ font-size: 14px;
+ color: #999;
+}
+
+.uni-table-mask {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: rgba(255, 255, 255, 0.8);
+ z-index: 99;
+ /* #ifndef APP-NVUE */
+ display: flex;
+ margin: auto;
+ transition: all 0.5s;
+ /* #endif */
+ justify-content: center;
+ align-items: center;
+}
+
+.uni-table--loader {
+ width: 30px;
+ height: 30px;
+ border: 2px solid #aaa;
+ // border-bottom-color: transparent;
+ border-radius: 50%;
+ /* #ifndef APP-NVUE */
+ animation: 2s uni-table--loader linear infinite;
+ /* #endif */
+ position: relative;
+}
+
+@keyframes uni-table--loader {
+ 0% {
+ transform: rotate(360deg);
+ }
+
+ 10% {
+ border-left-color: transparent;
+ }
+
+ 20% {
+ border-bottom-color: transparent;
+ }
+
+ 30% {
+ border-right-color: transparent;
+ }
+
+ 40% {
+ border-top-color: transparent;
+ }
+
+ 50% {
+ transform: rotate(0deg);
+ }
+
+ 60% {
+ border-top-color: transparent;
+ }
+
+ 70% {
+ border-left-color: transparent;
+ }
+
+ 80% {
+ border-bottom-color: transparent;
+ }
+
+ 90% {
+ border-right-color: transparent;
+ }
+
+ 100% {
+ transform: rotate(-360deg);
+ }
+}
+</style>
diff --git a/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue b/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue
new file mode 100644
index 0000000..130f626
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue
@@ -0,0 +1,34 @@
+<template>
+ <!-- #ifdef H5 -->
+ <tbody>
+ <slot></slot>
+ </tbody>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <view><slot></slot></view>
+ <!-- #endif -->
+</template>
+
+<script>
+export default {
+ name: 'uniBody',
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ data() {
+ return {
+
+ }
+ },
+ created() {},
+ methods: {}
+}
+</script>
+
+<style>
+</style>
diff --git a/uni_modules/uni-table/components/uni-td/uni-td.vue b/uni_modules/uni-table/components/uni-td/uni-td.vue
new file mode 100644
index 0000000..69e5e8a
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-td/uni-td.vue
@@ -0,0 +1,95 @@
+<template>
+ <!-- #ifdef H5 -->
+ <td class="uni-table-td" :rowspan="rowspan" :colspan="colspan" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}">
+ <slot></slot>
+ </td>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <!-- :class="{'table--border':border}" -->
+ <view class="uni-table-td" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}">
+ <slot></slot>
+ </view>
+ <!-- #endif -->
+
+</template>
+
+<script>
+ /**
+ * Td 鍗曞厓鏍�
+ * @description 琛ㄦ牸涓殑鏍囧噯鍗曞厓鏍肩粍浠�
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3270
+ * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮�
+ */
+ export default {
+ name: 'uniTd',
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ props: {
+ width: {
+ type: [String, Number],
+ default: ''
+ },
+ align: {
+ type: String,
+ default: 'left'
+ },
+ rowspan: {
+ type: [Number,String],
+ default: 1
+ },
+ colspan: {
+ type: [Number,String],
+ default: 1
+ }
+ },
+ data() {
+ return {
+ border: false
+ };
+ },
+ created() {
+ this.root = this.getTable()
+ this.border = this.root.border
+ },
+ methods: {
+ /**
+ * 鑾峰彇鐖跺厓绱犲疄渚�
+ */
+ getTable() {
+ let parent = this.$parent;
+ let parentName = parent.$options.name;
+ while (parentName !== 'uniTable') {
+ parent = parent.$parent;
+ if (!parent) return false;
+ parentName = parent.$options.name;
+ }
+ return parent;
+ },
+ }
+ }
+</script>
+
+<style lang="scss">
+ $border-color:#EBEEF5;
+
+ .uni-table-td {
+ display: table-cell;
+ padding: 8px 10px;
+ font-size: 14px;
+ border-bottom: 1px $border-color solid;
+ font-weight: 400;
+ color: #606266;
+ line-height: 23px;
+ box-sizing: border-box;
+ }
+
+ .table--border {
+ border-right: 1px $border-color solid;
+ }
+</style>
diff --git a/uni_modules/uni-table/components/uni-th/filter-dropdown.vue b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue
new file mode 100644
index 0000000..6f29b3b
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-th/filter-dropdown.vue
@@ -0,0 +1,511 @@
+<template>
+ <view class="uni-filter-dropdown">
+ <view class="dropdown-btn" @click="onDropdown">
+ <view class="icon-select" :class="{active: canReset}" v-if="isSelect || isRange"></view>
+ <view class="icon-search" :class="{active: canReset}" v-if="isSearch">
+ <view class="icon-search-0"></view>
+ <view class="icon-search-1"></view>
+ </view>
+ <view class="icon-calendar" :class="{active: canReset}" v-if="isDate">
+ <view class="icon-calendar-0"></view>
+ <view class="icon-calendar-1"></view>
+ </view>
+ </view>
+ <view class="uni-dropdown-cover" v-if="isOpened" @click="handleClose"></view>
+ <view class="dropdown-popup dropdown-popup-right" v-if="isOpened" @click.stop>
+ <!-- select-->
+ <view v-if="isSelect" class="list">
+ <label class="flex-r a-i-c list-item" v-for="(item,index) in dataList" :key="index"
+ @click="onItemClick($event, index)">
+ <check-box class="check" :checked="item.checked" />
+ <view class="checklist-content">
+ <text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
+ </view>
+ </label>
+ </view>
+ <view v-if="isSelect" class="flex-r opera-area">
+ <view class="flex-f btn btn-default" :class="{disable: !canReset}" @click="handleSelectReset">
+ {{resource.reset}}</view>
+ <view class="flex-f btn btn-submit" @click="handleSelectSubmit">{{resource.submit}}</view>
+ </view>
+ <!-- search -->
+ <view v-if="isSearch" class="search-area">
+ <input class="search-input" v-model="filterValue" />
+ </view>
+ <view v-if="isSearch" class="flex-r opera-area">
+ <view class="flex-f btn btn-submit" @click="handleSearchSubmit">{{resource.search}}</view>
+ <view class="flex-f btn btn-default" :class="{disable: !canReset}" @click="handleSearchReset">
+ {{resource.reset}}</view>
+ </view>
+ <!-- range -->
+ <view v-if="isRange">
+ <view class="input-label">{{resource.gt}}</view>
+ <input class="input" v-model="gtValue" />
+ <view class="input-label">{{resource.lt}}</view>
+ <input class="input" v-model="ltValue" />
+ </view>
+ <view v-if="isRange" class="flex-r opera-area">
+ <view class="flex-f btn btn-default" :class="{disable: !canReset}" @click="handleRangeReset">
+ {{resource.reset}}</view>
+ <view class="flex-f btn btn-submit" @click="handleRangeSubmit">{{resource.submit}}</view>
+ </view>
+ <!-- date -->
+ <view v-if="isDate">
+ <uni-datetime-picker ref="datetimepicker" :value="dateRange" type="datetimerange" return-type="timestamp" @change="datetimechange" @maskClick="timepickerclose">
+ <view></view>
+ </uni-datetime-picker>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ import checkBox from '../uni-tr/table-checkbox.vue'
+
+ const resource = {
+ "reset": "閲嶇疆",
+ "search": "鎼滅储",
+ "submit": "纭畾",
+ "filter": "绛涢��",
+ "gt": "澶т簬绛変簬",
+ "lt": "灏忎簬绛変簬",
+ "date": "鏃ユ湡鑼冨洿"
+ }
+
+ const DropdownType = {
+ Select: "select",
+ Search: "search",
+ Range: "range",
+ Date: "date",
+ Timestamp: "timestamp"
+ }
+
+ export default {
+ name: 'FilterDropdown',
+ emits:['change'],
+ components: {
+ checkBox
+ },
+ options: {
+ virtualHost: true
+ },
+ props: {
+ filterType: {
+ type: String,
+ default: DropdownType.Select
+ },
+ filterData: {
+ type: Array,
+ default () {
+ return []
+ }
+ },
+ mode: {
+ type: String,
+ default: 'default'
+ },
+ map: {
+ type: Object,
+ default () {
+ return {
+ text: 'text',
+ value: 'value'
+ }
+ }
+ },
+ filterDefaultValue: {
+ type: [Array,String],
+ default () {
+ return ""
+ }
+ }
+ },
+ computed: {
+ canReset() {
+ if (this.isSearch) {
+ return this.filterValue.length > 0
+ }
+ if (this.isSelect) {
+ return this.checkedValues.length > 0
+ }
+ if (this.isRange) {
+ return (this.gtValue.length > 0 && this.ltValue.length > 0)
+ }
+ if (this.isDate) {
+ return this.dateSelect.length > 0
+ }
+ return false
+ },
+ isSelect() {
+ return this.filterType === DropdownType.Select
+ },
+ isSearch() {
+ return this.filterType === DropdownType.Search
+ },
+ isRange() {
+ return this.filterType === DropdownType.Range
+ },
+ isDate() {
+ return (this.filterType === DropdownType.Date || this.filterType === DropdownType.Timestamp)
+ }
+ },
+ watch: {
+ filterData(newVal) {
+ this._copyFilters()
+ },
+ indeterminate(newVal) {
+ this.isIndeterminate = newVal
+ }
+ },
+ data() {
+ return {
+ resource,
+ enabled: true,
+ isOpened: false,
+ dataList: [],
+ filterValue: this.filterDefaultValue,
+ checkedValues: [],
+ gtValue: '',
+ ltValue: '',
+ dateRange: [],
+ dateSelect: []
+ };
+ },
+ created() {
+ this._copyFilters()
+ },
+ methods: {
+ _copyFilters() {
+ let dl = JSON.parse(JSON.stringify(this.filterData))
+ for (let i = 0; i < dl.length; i++) {
+ if (dl[i].checked === undefined) {
+ dl[i].checked = false
+ }
+ }
+ this.dataList = dl
+ },
+ openPopup() {
+ this.isOpened = true
+ if (this.isDate) {
+ this.$nextTick(() => {
+ if (!this.dateRange.length) {
+ this.resetDate()
+ }
+ this.$refs.datetimepicker.show()
+ })
+ }
+ },
+ closePopup() {
+ this.isOpened = false
+ },
+ handleClose(e) {
+ this.closePopup()
+ },
+ resetDate() {
+ let date = new Date()
+ let dateText = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
+ this.dateRange = [dateText + ' 0:00:00', dateText + ' 23:59:59']
+ },
+ onDropdown(e) {
+ this.openPopup()
+ },
+ onItemClick(e, index) {
+ let items = this.dataList
+ let listItem = items[index]
+ if (listItem.checked === undefined) {
+ items[index].checked = true
+ } else {
+ items[index].checked = !listItem.checked
+ }
+
+ let checkvalues = []
+ for (let i = 0; i < items.length; i++) {
+ const item = items[i]
+ if (item.checked) {
+ checkvalues.push(item.value)
+ }
+ }
+ this.checkedValues = checkvalues
+ },
+ datetimechange(e) {
+ this.closePopup()
+ this.dateRange = e
+ this.dateSelect = e
+ this.$emit('change', {
+ filterType: this.filterType,
+ filter: e
+ })
+ },
+ timepickerclose(e) {
+ this.closePopup()
+ },
+ handleSelectSubmit() {
+ this.closePopup()
+ this.$emit('change', {
+ filterType: this.filterType,
+ filter: this.checkedValues
+ })
+ },
+ handleSelectReset() {
+ if (!this.canReset) {
+ return;
+ }
+ var items = this.dataList
+ for (let i = 0; i < items.length; i++) {
+ let item = items[i]
+ this.$set(item, 'checked', false)
+ }
+ this.checkedValues = []
+ this.handleSelectSubmit()
+ },
+ handleSearchSubmit() {
+ this.closePopup()
+ this.$emit('change', {
+ filterType: this.filterType,
+ filter: this.filterValue
+ })
+ },
+ handleSearchReset() {
+ if (!this.canReset) {
+ return;
+ }
+ this.filterValue = ''
+ this.handleSearchSubmit()
+ },
+ handleRangeSubmit(isReset) {
+ this.closePopup()
+ this.$emit('change', {
+ filterType: this.filterType,
+ filter: isReset === true ? [] : [parseInt(this.gtValue), parseInt(this.ltValue)]
+ })
+ },
+ handleRangeReset() {
+ if (!this.canReset) {
+ return;
+ }
+ this.gtValue = ''
+ this.ltValue = ''
+ this.handleRangeSubmit(true)
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ $uni-primary: #1890ff !default;
+
+ .flex-r {
+ display: flex;
+ flex-direction: row;
+ }
+
+ .flex-f {
+ flex: 1;
+ }
+
+ .a-i-c {
+ align-items: center;
+ }
+
+ .j-c-c {
+ justify-content: center;
+ }
+
+ .icon-select {
+ width: 14px;
+ height: 16px;
+ border: solid 6px transparent;
+ border-top: solid 6px #ddd;
+ border-bottom: none;
+ background-color: #ddd;
+ background-clip: content-box;
+ box-sizing: border-box;
+ }
+
+ .icon-select.active {
+ background-color: $uni-primary;
+ border-top-color: $uni-primary;
+ }
+
+ .icon-search {
+ width: 12px;
+ height: 16px;
+ position: relative;
+ }
+
+ .icon-search-0 {
+ border: 2px solid #ddd;
+ border-radius: 8px;
+ width: 7px;
+ height: 7px;
+ }
+
+ .icon-search-1 {
+ position: absolute;
+ top: 8px;
+ right: 0;
+ width: 1px;
+ height: 7px;
+ background-color: #ddd;
+ transform: rotate(-45deg);
+ }
+
+ .icon-search.active .icon-search-0 {
+ border-color: $uni-primary;
+ }
+
+ .icon-search.active .icon-search-1 {
+ background-color: $uni-primary;
+ }
+
+ .icon-calendar {
+ color: #ddd;
+ width: 14px;
+ height: 16px;
+ }
+
+ .icon-calendar-0 {
+ height: 4px;
+ margin-top: 3px;
+ margin-bottom: 1px;
+ background-color: #ddd;
+ border-radius: 2px 2px 1px 1px;
+ position: relative;
+ }
+ .icon-calendar-0:before, .icon-calendar-0:after {
+ content: '';
+ position: absolute;
+ top: -3px;
+ width: 4px;
+ height: 3px;
+ border-radius: 1px;
+ background-color: #ddd;
+ }
+ .icon-calendar-0:before {
+ left: 2px;
+ }
+ .icon-calendar-0:after {
+ right: 2px;
+ }
+
+ .icon-calendar-1 {
+ height: 9px;
+ background-color: #ddd;
+ border-radius: 1px 1px 2px 2px;
+ }
+
+ .icon-calendar.active {
+ color: $uni-primary;
+ }
+
+ .icon-calendar.active .icon-calendar-0,
+ .icon-calendar.active .icon-calendar-1,
+ .icon-calendar.active .icon-calendar-0:before,
+ .icon-calendar.active .icon-calendar-0:after {
+ background-color: $uni-primary;
+ }
+
+ .uni-filter-dropdown {
+ position: relative;
+ font-weight: normal;
+ }
+
+ .dropdown-popup {
+ position: absolute;
+ top: 100%;
+ background-color: #fff;
+ box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
+ min-width: 150px;
+ z-index: 1000;
+ }
+
+ .dropdown-popup-left {
+ left: 0;
+ }
+
+ .dropdown-popup-right {
+ right: 0;
+ }
+
+ .uni-dropdown-cover {
+ position: fixed;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ background-color: transparent;
+ z-index: 100;
+ }
+
+ .list {
+ margin-top: 5px;
+ margin-bottom: 5px;
+ }
+
+ .list-item {
+ padding: 5px 10px;
+ text-align: left;
+ }
+
+ .list-item:hover {
+ background-color: #f0f0f0;
+ }
+
+ .check {
+ margin-right: 5px;
+ }
+
+ .search-area {
+ padding: 10px;
+ }
+
+ .search-input {
+ font-size: 12px;
+ border: 1px solid #f0f0f0;
+ border-radius: 3px;
+ padding: 2px 5px;
+ min-width: 150px;
+ text-align: left;
+ }
+
+ .input-label {
+ margin: 10px 10px 5px 10px;
+ text-align: left;
+ }
+
+ .input {
+ font-size: 12px;
+ border: 1px solid #f0f0f0;
+ border-radius: 3px;
+ margin: 10px;
+ padding: 2px 5px;
+ min-width: 150px;
+ text-align: left;
+ }
+
+ .opera-area {
+ cursor: default;
+ border-top: 1px solid #ddd;
+ padding: 5px;
+ }
+
+ .opera-area .btn {
+ font-size: 12px;
+ border-radius: 3px;
+ margin: 5px;
+ padding: 4px 4px;
+ }
+
+ .btn-default {
+ border: 1px solid #ddd;
+ }
+
+ .btn-default.disable {
+ border-color: transparent;
+ }
+
+ .btn-submit {
+ background-color: $uni-primary;
+ color: #ffffff;
+ }
+</style>
diff --git a/uni_modules/uni-table/components/uni-th/uni-th.vue b/uni_modules/uni-table/components/uni-th/uni-th.vue
new file mode 100644
index 0000000..a39ae6c
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-th/uni-th.vue
@@ -0,0 +1,295 @@
+<template>
+ <!-- #ifdef H5 -->
+ <th :rowspan="rowspan" :colspan="colspan" class="uni-table-th" :class="{ 'table--border': border }" :style="{ width: customWidth + 'px', 'text-align': align }">
+ <view class="uni-table-th-row">
+ <view class="uni-table-th-content" :style="{ 'justify-content': contentAlign }" @click="sort">
+ <slot></slot>
+ <view v-if="sortable" class="arrow-box">
+ <text class="arrow up" :class="{ active: ascending }" @click.stop="ascendingFn"></text>
+ <text class="arrow down" :class="{ active: descending }" @click.stop="descendingFn"></text>
+ </view>
+ </view>
+ <dropdown v-if="filterType || filterData.length" :filterDefaultValue="filterDefaultValue" :filterData="filterData" :filterType="filterType" @change="ondropdown"></dropdown>
+ </view>
+ </th>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <view class="uni-table-th" :class="{ 'table--border': border }" :style="{ width: customWidth + 'px', 'text-align': align }"><slot></slot></view>
+ <!-- #endif -->
+</template>
+
+<script>
+ // #ifdef H5
+ import dropdown from './filter-dropdown.vue'
+ // #endif
+/**
+ * Th 琛ㄥご
+ * @description 琛ㄦ牸鍐呯殑琛ㄥご鍗曞厓鏍肩粍浠�
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3270
+ * @property {Number | String} width 鍗曞厓鏍煎搴︼紙鏀寔绾暟瀛椼�佹惡甯﹀崟浣峱x鎴杛px锛�
+ * @property {Boolean} sortable 鏄惁鍚敤鎺掑簭
+ * @property {Number} align = [left|center|right] 鍗曞厓鏍煎榻愭柟寮�
+ * @value left 鍗曞厓鏍兼枃瀛楀乏渚у榻�
+ * @value center 鍗曞厓鏍兼枃瀛楀眳涓�
+ * @value right 鍗曞厓鏍兼枃瀛楀彸渚у榻�
+ * @property {Array} filterData 绛涢�夋暟鎹�
+ * @property {String} filterType [search|select] 绛涢�夌被鍨�
+ * @value search 鍏抽敭瀛楁悳绱�
+ * @value select 鏉′欢閫夋嫨
+ * @event {Function} sort-change 鎺掑簭瑙﹀彂浜嬩欢
+ */
+export default {
+ name: 'uniTh',
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ components: {
+ // #ifdef H5
+ dropdown
+ // #endif
+ },
+ emits:['sort-change','filter-change'],
+ props: {
+ width: {
+ type: [String, Number],
+ default: ''
+ },
+ align: {
+ type: String,
+ default: 'left'
+ },
+ rowspan: {
+ type: [Number, String],
+ default: 1
+ },
+ colspan: {
+ type: [Number, String],
+ default: 1
+ },
+ sortable: {
+ type: Boolean,
+ default: false
+ },
+ filterType: {
+ type: String,
+ default: ""
+ },
+ filterData: {
+ type: Array,
+ default () {
+ return []
+ }
+ },
+ filterDefaultValue: {
+ type: [Array,String],
+ default () {
+ return ""
+ }
+ }
+ },
+ data() {
+ return {
+ border: false,
+ ascending: false,
+ descending: false
+ }
+ },
+ computed: {
+ // 鏍规嵁props涓殑width灞炴�� 鑷姩鍖归厤褰撳墠th鐨勫搴�(px)
+ customWidth(){
+ if(typeof this.width === 'number'){
+ return this.width
+ } else if(typeof this.width === 'string') {
+ let regexHaveUnitPx = new RegExp(/^[1-9][0-9]*px$/g)
+ let regexHaveUnitRpx = new RegExp(/^[1-9][0-9]*rpx$/g)
+ let regexHaveNotUnit = new RegExp(/^[1-9][0-9]*$/g)
+ if (this.width.match(regexHaveUnitPx) !== null) { // 鎼哄甫浜� px
+ return this.width.replace('px', '')
+ } else if (this.width.match(regexHaveUnitRpx) !== null) { // 鎼哄甫浜� rpx
+ let numberRpx = Number(this.width.replace('rpx', ''))
+ // #ifdef MP-WEIXIN
+ let widthCoe = uni.getWindowInfo().screenWidth / 750
+ // #endif
+ // #ifndef MP-WEIXIN
+ let widthCoe = uni.getSystemInfoSync().screenWidth / 750
+ // #endif
+ return Math.round(numberRpx * widthCoe)
+ } else if (this.width.match(regexHaveNotUnit) !== null) { // 鏈惡甯� rpx鎴杙x 鐨勭函鏁板瓧 String
+ return this.width
+ } else { // 涓嶇鍚堟牸寮�
+ return ''
+ }
+ } else {
+ return ''
+ }
+ },
+ contentAlign() {
+ let align = 'left'
+ switch (this.align) {
+ case 'left':
+ align = 'flex-start'
+ break
+ case 'center':
+ align = 'center'
+ break
+ case 'right':
+ align = 'flex-end'
+ break
+ }
+ return align
+ }
+ },
+ created() {
+ this.root = this.getTable('uniTable')
+ this.rootTr = this.getTable('uniTr')
+ this.rootTr.minWidthUpdate(this.customWidth ? this.customWidth : 140)
+ this.border = this.root.border
+ this.root.thChildren.push(this)
+ },
+ methods: {
+ sort() {
+ if (!this.sortable) return
+ this.clearOther()
+ if (!this.ascending && !this.descending) {
+ this.ascending = true
+ this.$emit('sort-change', { order: 'ascending' })
+ return
+ }
+ if (this.ascending && !this.descending) {
+ this.ascending = false
+ this.descending = true
+ this.$emit('sort-change', { order: 'descending' })
+ return
+ }
+
+ if (!this.ascending && this.descending) {
+ this.ascending = false
+ this.descending = false
+ this.$emit('sort-change', { order: null })
+ }
+ },
+ ascendingFn() {
+ this.clearOther()
+ this.ascending = !this.ascending
+ this.descending = false
+ this.$emit('sort-change', { order: this.ascending ? 'ascending' : null })
+ },
+ descendingFn() {
+ this.clearOther()
+ this.descending = !this.descending
+ this.ascending = false
+ this.$emit('sort-change', { order: this.descending ? 'descending' : null })
+ },
+ clearOther() {
+ this.root.thChildren.map(item => {
+ if (item !== this) {
+ item.ascending = false
+ item.descending = false
+ }
+ return item
+ })
+ },
+ ondropdown(e) {
+ this.$emit("filter-change", e)
+ },
+ /**
+ * 鑾峰彇鐖跺厓绱犲疄渚�
+ */
+ getTable(name) {
+ let parent = this.$parent
+ let parentName = parent.$options.name
+ while (parentName !== name) {
+ parent = parent.$parent
+ if (!parent) return false
+ parentName = parent.$options.name
+ }
+ return parent
+ }
+ }
+}
+</script>
+
+<style lang="scss">
+$border-color: #ebeef5;
+$uni-primary: #007aff !default;
+
+.uni-table-th {
+ padding: 12px 10px;
+ /* #ifndef APP-NVUE */
+ display: table-cell;
+ box-sizing: border-box;
+ /* #endif */
+ font-size: 14px;
+ font-weight: bold;
+ color: #909399;
+ border-bottom: 1px $border-color solid;
+}
+
+.uni-table-th-row {
+ /* #ifndef APP-NVUE */
+ display: flex;
+ /* #endif */
+ flex-direction: row;
+}
+
+.table--border {
+ border-right: 1px $border-color solid;
+}
+.uni-table-th-content {
+ display: flex;
+ align-items: center;
+ flex: 1;
+}
+.arrow-box {
+}
+.arrow {
+ display: block;
+ position: relative;
+ width: 10px;
+ height: 8px;
+ // border: 1px red solid;
+ left: 5px;
+ overflow: hidden;
+ cursor: pointer;
+}
+.down {
+ top: 3px;
+ ::after {
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ left: 2px;
+ top: -5px;
+ transform: rotate(45deg);
+ background-color: #ccc;
+ }
+ &.active {
+ ::after {
+ background-color: $uni-primary;
+ }
+ }
+}
+.up {
+ ::after {
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ left: 2px;
+ top: 5px;
+ transform: rotate(45deg);
+ background-color: #ccc;
+ }
+ &.active {
+ ::after {
+ background-color: $uni-primary;
+ }
+ }
+}
+</style>
diff --git a/uni_modules/uni-table/components/uni-thead/uni-thead.vue b/uni_modules/uni-table/components/uni-thead/uni-thead.vue
new file mode 100644
index 0000000..53b5c4c
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-thead/uni-thead.vue
@@ -0,0 +1,137 @@
+<template>
+ <!-- #ifdef H5 -->
+ <thead class="uni-table-thead">
+ <tr class="uni-table-tr">
+ <th :rowspan="rowspan" colspan="1" class="checkbox" :class="{ 'tr-table--border': border }">
+ <table-checkbox :indeterminate="indeterminate" :checked="checked"
+ @checkboxSelected="checkboxSelected"></table-checkbox>
+ </th>
+ </tr>
+ <slot></slot>
+ </thead>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <view class="uni-table-thead">
+ <slot></slot>
+ </view>
+ <!-- #endif -->
+</template>
+
+<script>
+ import tableCheckbox from '../uni-tr/table-checkbox.vue'
+ export default {
+ name: 'uniThead',
+ components: {
+ tableCheckbox
+ },
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ data() {
+ return {
+ border: false,
+ selection: false,
+ rowspan: 1,
+ indeterminate: false,
+ checked: false
+ }
+ },
+ created() {
+ this.root = this.getTable()
+ // #ifdef H5
+ this.root.theadChildren = this
+ // #endif
+ this.border = this.root.border
+ this.selection = this.root.type
+ },
+ methods: {
+ init(self) {
+ this.rowspan++
+ },
+ checkboxSelected(e) {
+ this.indeterminate = false
+ const backIndexData = this.root.backIndexData
+ const data = this.root.trChildren.filter(v => !v.disabled && v.keyValue)
+ if (backIndexData.length === data.length) {
+ this.checked = false
+ this.root.clearSelection()
+ } else {
+ this.checked = true
+ this.root.selectionAll()
+ }
+ },
+ /**
+ * 鑾峰彇鐖跺厓绱犲疄渚�
+ */
+ getTable(name = 'uniTable') {
+ let parent = this.$parent
+ let parentName = parent.$options.name
+ while (parentName !== name) {
+ parent = parent.$parent
+ if (!parent) return false
+ parentName = parent.$options.name
+ }
+ return parent
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ $border-color: #ebeef5;
+
+ .uni-table-thead {
+ display: table-header-group;
+ }
+
+ .uni-table-tr {
+ /* #ifndef APP-NVUE */
+ display: table-row;
+ transition: all 0.3s;
+ box-sizing: border-box;
+ /* #endif */
+ border: 1px red solid;
+ background-color: #fafafa;
+ }
+
+ .checkbox {
+ padding: 0 8px;
+ width: 26px;
+ padding-left: 12px;
+ /* #ifndef APP-NVUE */
+ display: table-cell;
+ vertical-align: middle;
+ /* #endif */
+ color: #333;
+ font-weight: 500;
+ border-bottom: 1px $border-color solid;
+ font-size: 14px;
+ // text-align: center;
+ }
+
+ .tr-table--border {
+ border-right: 1px $border-color solid;
+ }
+
+ /* #ifndef APP-NVUE */
+ .uni-table-tr {
+ ::v-deep .uni-table-th {
+ &.table--border:last-child {
+ // border-right: none;
+ }
+ }
+
+ ::v-deep .uni-table-td {
+ &.table--border:last-child {
+ // border-right: none;
+ }
+ }
+ }
+
+ /* #endif */
+</style>
diff --git a/uni_modules/uni-table/components/uni-tr/table-checkbox.vue b/uni_modules/uni-table/components/uni-tr/table-checkbox.vue
new file mode 100644
index 0000000..1089187
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-tr/table-checkbox.vue
@@ -0,0 +1,179 @@
+<template>
+ <view class="uni-table-checkbox" @click="selected">
+ <view v-if="!indeterminate" class="checkbox__inner" :class="{'is-checked':isChecked,'is-disable':isDisabled}">
+ <view class="checkbox__inner-icon"></view>
+ </view>
+ <view v-else class="checkbox__inner checkbox--indeterminate">
+ <view class="checkbox__inner-icon"></view>
+ </view>
+ </view>
+</template>
+
+<script>
+ export default {
+ name: 'TableCheckbox',
+ emits:['checkboxSelected'],
+ props: {
+ indeterminate: {
+ type: Boolean,
+ default: false
+ },
+ checked: {
+ type: [Boolean,String],
+ default: false
+ },
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ index: {
+ type: Number,
+ default: -1
+ },
+ cellData: {
+ type: Object,
+ default () {
+ return {}
+ }
+ }
+ },
+ watch:{
+ checked(newVal){
+ if(typeof this.checked === 'boolean'){
+ this.isChecked = newVal
+ }else{
+ this.isChecked = true
+ }
+ },
+ indeterminate(newVal){
+ this.isIndeterminate = newVal
+ }
+ },
+ data() {
+ return {
+ isChecked: false,
+ isDisabled: false,
+ isIndeterminate:false
+ }
+ },
+ created() {
+ if(typeof this.checked === 'boolean'){
+ this.isChecked = this.checked
+ }
+ this.isDisabled = this.disabled
+ },
+ methods: {
+ selected() {
+ if (this.isDisabled) return
+ this.isIndeterminate = false
+ this.isChecked = !this.isChecked
+ this.$emit('checkboxSelected', {
+ checked: this.isChecked,
+ data: this.cellData
+ })
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ $uni-primary: #007aff !default;
+ $border-color: #DCDFE6;
+ $disable:0.4;
+
+ .uni-table-checkbox {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ margin: 5px 0;
+ cursor: pointer;
+
+ // 澶氶�夋牱寮�
+ .checkbox__inner {
+ /* #ifndef APP-NVUE */
+ flex-shrink: 0;
+ box-sizing: border-box;
+ /* #endif */
+ position: relative;
+ width: 16px;
+ height: 16px;
+ border: 1px solid $border-color;
+ border-radius: 2px;
+ background-color: #fff;
+ z-index: 1;
+
+ .checkbox__inner-icon {
+ position: absolute;
+ /* #ifdef APP-NVUE */
+ top: 2px;
+ /* #endif */
+ /* #ifndef APP-NVUE */
+ top: 2px;
+ /* #endif */
+ left: 5px;
+ height: 7px;
+ width: 3px;
+ border: 1px solid #fff;
+ border-left: 0;
+ border-top: 0;
+ opacity: 0;
+ transform-origin: center;
+ transform: rotate(45deg);
+ box-sizing: content-box;
+ }
+
+ &.checkbox--indeterminate {
+ border-color: $uni-primary;
+ background-color: $uni-primary;
+
+ .checkbox__inner-icon {
+ position: absolute;
+ opacity: 1;
+ transform: rotate(0deg);
+ height: 2px;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ left: 0px;
+ right: 0px;
+ bottom: 0;
+ width: auto;
+ border: none;
+ border-radius: 2px;
+ transform: scale(0.5);
+ background-color: #fff;
+ }
+ }
+ &:hover{
+ border-color: $uni-primary;
+ }
+ // 绂佺敤
+ &.is-disable {
+ /* #ifdef H5 */
+ cursor: not-allowed;
+ /* #endif */
+ background-color: #F2F6FC;
+ border-color: $border-color;
+ }
+
+ // 閫変腑
+ &.is-checked {
+ border-color: $uni-primary;
+ background-color: $uni-primary;
+
+ .checkbox__inner-icon {
+ opacity: 1;
+ transform: rotate(45deg);
+ }
+
+ // 閫変腑绂佺敤
+ &.is-disable {
+ opacity: $disable;
+ }
+ }
+
+ }
+ }
+</style>
diff --git a/uni_modules/uni-table/components/uni-tr/uni-tr.vue b/uni_modules/uni-table/components/uni-tr/uni-tr.vue
new file mode 100644
index 0000000..3fb76f4
--- /dev/null
+++ b/uni_modules/uni-table/components/uni-tr/uni-tr.vue
@@ -0,0 +1,184 @@
+<template>
+ <!-- #ifdef H5 -->
+ <tr class="uni-table-tr">
+ <th v-if="selection === 'selection' && ishead" class="checkbox" :class="{ 'tr-table--border': border }">
+ <table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled"
+ @checkboxSelected="checkboxSelected"></table-checkbox>
+ </th>
+ <slot></slot>
+ <!-- <uni-th class="th-fixed">123</uni-th> -->
+ </tr>
+ <!-- #endif -->
+ <!-- #ifndef H5 -->
+ <view class="uni-table-tr">
+ <view v-if="selection === 'selection' " class="checkbox" :class="{ 'tr-table--border': border }">
+ <table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled"
+ @checkboxSelected="checkboxSelected"></table-checkbox>
+ </view>
+ <slot></slot>
+ </view>
+ <!-- #endif -->
+</template>
+
+<script>
+ import tableCheckbox from './table-checkbox.vue'
+ /**
+ * Tr 琛ㄦ牸琛岀粍浠�
+ * @description 琛ㄦ牸琛岀粍浠� 浠呭寘鍚� th,td 缁勪欢
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=
+ */
+ export default {
+ name: 'uniTr',
+ components: {
+ tableCheckbox
+ },
+ props: {
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ keyValue: {
+ type: [String, Number],
+ default: ''
+ }
+ },
+ options: {
+ // #ifdef MP-TOUTIAO
+ virtualHost: false,
+ // #endif
+ // #ifndef MP-TOUTIAO
+ virtualHost: true
+ // #endif
+ },
+ data() {
+ return {
+ value: false,
+ border: false,
+ selection: false,
+ widthThArr: [],
+ ishead: true,
+ checked: false,
+ indeterminate: false
+ }
+ },
+ created() {
+ this.root = this.getTable()
+ this.head = this.getTable('uniThead')
+ if (this.head) {
+ this.ishead = false
+ this.head.init(this)
+ }
+ this.border = this.root.border
+ this.selection = this.root.type
+ this.root.trChildren.push(this)
+ const rowData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
+ if (rowData) {
+ this.rowData = rowData
+ }
+ this.root.isNodata()
+ },
+ mounted() {
+ if (this.widthThArr.length > 0) {
+ const selectionWidth = this.selection === 'selection' ? 50 : 0
+ this.root.minWidth = Number(this.widthThArr.reduce((a, b) => Number(a) + Number(b))) + selectionWidth;
+ }
+ },
+ // #ifndef VUE3
+ destroyed() {
+ const index = this.root.trChildren.findIndex(i => i === this)
+ this.root.trChildren.splice(index, 1)
+ this.root.isNodata()
+ },
+ // #endif
+ // #ifdef VUE3
+ unmounted() {
+ const index = this.root.trChildren.findIndex(i => i === this)
+ this.root.trChildren.splice(index, 1)
+ this.root.isNodata()
+ },
+ // #endif
+ methods: {
+ minWidthUpdate(width) {
+ this.widthThArr.push(width)
+ if (this.widthThArr.length > 0) {
+ const selectionWidth = this.selection === 'selection' ? 50 : 0;
+ this.root.minWidth = Number(this.widthThArr.reduce((a, b) => Number(a) + Number(b))) + selectionWidth;
+ }
+ },
+ // 閫変腑
+ checkboxSelected(e) {
+ let rootData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
+ this.checked = e.checked
+ this.root.check(rootData || this, e.checked, rootData ? this.keyValue : null)
+ },
+ change(e) {
+ this.root.trChildren.forEach(item => {
+ if (item === this) {
+ this.root.check(this, e.detail.value.length > 0 ? true : false)
+ }
+ })
+ },
+ /**
+ * 鑾峰彇鐖跺厓绱犲疄渚�
+ */
+ getTable(name = 'uniTable') {
+ let parent = this.$parent
+ let parentName = parent.$options.name
+ while (parentName !== name) {
+ parent = parent.$parent
+ if (!parent) return false
+ parentName = parent.$options.name
+ }
+ return parent
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ $border-color: #ebeef5;
+
+ .uni-table-tr {
+ /* #ifndef APP-NVUE */
+ display: table-row;
+ transition: all 0.3s;
+ box-sizing: border-box;
+ /* #endif */
+ }
+
+ .checkbox {
+ padding: 0 8px;
+ width: 26px;
+ padding-left: 12px;
+ /* #ifndef APP-NVUE */
+ display: table-cell;
+ vertical-align: middle;
+ /* #endif */
+ color: #333;
+ font-weight: 500;
+ border-bottom: 1px $border-color solid;
+ font-size: 14px;
+ // text-align: center;
+ }
+
+ .tr-table--border {
+ border-right: 1px $border-color solid;
+ }
+
+ /* #ifndef APP-NVUE */
+ .uni-table-tr {
+ ::v-deep .uni-table-th {
+ &.table--border:last-child {
+ // border-right: none;
+ }
+ }
+
+ ::v-deep .uni-table-td {
+ &.table--border:last-child {
+ // border-right: none;
+ }
+ }
+ }
+
+ /* #endif */
+</style>
diff --git a/uni_modules/uni-table/i18n/en.json b/uni_modules/uni-table/i18n/en.json
new file mode 100644
index 0000000..e32023c
--- /dev/null
+++ b/uni_modules/uni-table/i18n/en.json
@@ -0,0 +1,9 @@
+{
+ "filter-dropdown.reset": "Reset",
+ "filter-dropdown.search": "Search",
+ "filter-dropdown.submit": "Submit",
+ "filter-dropdown.filter": "Filter",
+ "filter-dropdown.gt": "Greater or equal to",
+ "filter-dropdown.lt": "Less than or equal to",
+ "filter-dropdown.date": "Date"
+}
diff --git a/uni_modules/uni-table/i18n/es.json b/uni_modules/uni-table/i18n/es.json
new file mode 100644
index 0000000..9afd04b
--- /dev/null
+++ b/uni_modules/uni-table/i18n/es.json
@@ -0,0 +1,9 @@
+{
+ "filter-dropdown.reset": "Reiniciar",
+ "filter-dropdown.search": "B煤squeda",
+ "filter-dropdown.submit": "Entregar",
+ "filter-dropdown.filter": "Filtrar",
+ "filter-dropdown.gt": "Mayor o igual a",
+ "filter-dropdown.lt": "Menos que o igual a",
+ "filter-dropdown.date": "Fecha"
+}
diff --git a/uni_modules/uni-table/i18n/fr.json b/uni_modules/uni-table/i18n/fr.json
new file mode 100644
index 0000000..b006237
--- /dev/null
+++ b/uni_modules/uni-table/i18n/fr.json
@@ -0,0 +1,9 @@
+{
+ "filter-dropdown.reset": "R茅initialiser",
+ "filter-dropdown.search": "Chercher",
+ "filter-dropdown.submit": "Soumettre",
+ "filter-dropdown.filter": "Filtre",
+ "filter-dropdown.gt": "Sup茅rieur ou 茅gal 脿",
+ "filter-dropdown.lt": "Inf茅rieur ou 茅gal 脿",
+ "filter-dropdown.date": "Date"
+}
diff --git a/uni_modules/uni-table/i18n/index.js b/uni_modules/uni-table/i18n/index.js
new file mode 100644
index 0000000..2469dd0
--- /dev/null
+++ b/uni_modules/uni-table/i18n/index.js
@@ -0,0 +1,12 @@
+import en from './en.json'
+import es from './es.json'
+import fr from './fr.json'
+import zhHans from './zh-Hans.json'
+import zhHant from './zh-Hant.json'
+export default {
+ en,
+ es,
+ fr,
+ 'zh-Hans': zhHans,
+ 'zh-Hant': zhHant
+}
diff --git a/uni_modules/uni-table/i18n/zh-Hans.json b/uni_modules/uni-table/i18n/zh-Hans.json
new file mode 100644
index 0000000..862af17
--- /dev/null
+++ b/uni_modules/uni-table/i18n/zh-Hans.json
@@ -0,0 +1,9 @@
+{
+ "filter-dropdown.reset": "閲嶇疆",
+ "filter-dropdown.search": "鎼滅储",
+ "filter-dropdown.submit": "纭畾",
+ "filter-dropdown.filter": "绛涢��",
+ "filter-dropdown.gt": "澶т簬绛変簬",
+ "filter-dropdown.lt": "灏忎簬绛変簬",
+ "filter-dropdown.date": "鏃ユ湡鑼冨洿"
+}
diff --git a/uni_modules/uni-table/i18n/zh-Hant.json b/uni_modules/uni-table/i18n/zh-Hant.json
new file mode 100644
index 0000000..64f8061
--- /dev/null
+++ b/uni_modules/uni-table/i18n/zh-Hant.json
@@ -0,0 +1,9 @@
+{
+ "filter-dropdown.reset": "閲嶇疆",
+ "filter-dropdown.search": "鎼滅储",
+ "filter-dropdown.submit": "纰哄畾",
+ "filter-dropdown.filter": "绡╅伕",
+ "filter-dropdown.gt": "澶ф柤绛夋柤",
+ "filter-dropdown.lt": "灏忔柤绛夋柤",
+ "filter-dropdown.date": "鏃ユ湡绡勫湇"
+}
diff --git a/uni_modules/uni-table/package.json b/uni_modules/uni-table/package.json
new file mode 100644
index 0000000..f581f43
--- /dev/null
+++ b/uni_modules/uni-table/package.json
@@ -0,0 +1,86 @@
+{
+ "id": "uni-table",
+ "displayName": "uni-table 琛ㄦ牸",
+ "version": "1.2.9",
+ "description": "琛ㄦ牸缁勪欢锛屽鐢ㄤ簬灞曠ず澶氭潯缁撴瀯绫讳技鐨勬暟鎹紝濡�",
+ "keywords": [
+ "uni-ui",
+ "uniui",
+ "table",
+ "琛ㄦ牸"
+],
+ "repository": "https://github.com/dcloudio/uni-ui",
+ "engines": {
+ "HBuilderX": ""
+ },
+ "directories": {
+ "example": "../../temps/example_temps"
+ },
+"dcloudext": {
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "鏃�",
+ "data": "鏃�",
+ "permissions": "鏃�"
+ },
+ "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+ "type": "component-vue"
+ },
+ "uni_modules": {
+ "dependencies": ["uni-scss","uni-datetime-picker"],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "y",
+ "aliyun": "y",
+ "alipay": "n"
+ },
+ "client": {
+ "App": {
+ "app-vue": "y",
+ "app-nvue": "n",
+ "app-harmony": "u",
+ "app-uvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "寰俊娴忚鍣�(Android)": "y",
+ "QQ娴忚鍣�(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "y",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "灏忕▼搴�": {
+ "寰俊": "y",
+ "闃块噷": "y",
+ "鐧惧害": "y",
+ "瀛楄妭璺冲姩": "n",
+ "QQ": "y"
+ },
+ "蹇簲鐢�": {
+ "鍗庝负": "n",
+ "鑱旂洘": "n"
+ },
+ "Vue": {
+ "vue2": "y",
+ "vue3": "y"
+ }
+ }
+ }
+ }
+}
diff --git a/uni_modules/uni-table/readme.md b/uni_modules/uni-table/readme.md
new file mode 100644
index 0000000..bb08c79
--- /dev/null
+++ b/uni_modules/uni-table/readme.md
@@ -0,0 +1,13 @@
+
+
+## Table 琛ㄥ崟
+> 缁勪欢鍚嶏細``uni-table``锛屼唬鐮佸潡锛� `uTable`銆�
+
+鐢ㄤ簬灞曠ず澶氭潯缁撴瀯绫讳技鐨勬暟鎹�
+
+### [鏌ョ湅鏂囨。](https://uniapp.dcloud.io/component/uniui/uni-table)
+#### 濡備娇鐢ㄨ繃绋嬩腑鏈変换浣曢棶棰橈紝鎴栬�呮偍瀵箄ni-ui鏈変竴浜涘ソ鐨勫缓璁紝娆㈣繋鍔犲叆 uni-ui 浜ゆ祦缇わ細871950839
+
+
+
+
--
Gitblit v1.8.0