From 7e98709d064bee78178f3096978c0ddf24f95b70 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Thu, 25 Apr 2024 18:09:35 +0800
Subject: [PATCH] add
---
App.vue | 3 +-
components/productConSwiper/indexNew.vue | 7 +-
pages.json | 10 +-
pages/admin/goods_details/index.vue | 139 +++++++++++++++---
pages/admin/goods_details/videoPlay.nvue | 45 ++++++
pages/product/addGood/addGood.vue | 26 +++-
pages/product/addGoodDetail/addGoodDetail.vue | 74 ++++++++--
pages/product/addGoodDetail/goodsAttr.vue | 2 +-
pages/product/addGoodDetail/goodsPrice.vue | 55 ++++---
pages/product/list/index.vue | 4 +-
pages/product/updateStock/updateStock.vue | 5 +-
11 files changed, 299 insertions(+), 71 deletions(-)
create mode 100644 pages/admin/goods_details/videoPlay.nvue
diff --git a/App.vue b/App.vue
index 3d5f87d..d34dde9 100644
--- a/App.vue
+++ b/App.vue
@@ -405,7 +405,8 @@
//console.log('App Hide')
},
watch: {
- // 记录H5和公众号
+ // https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/40390202404250914319725.mp4
+ // 记录H5和公众号?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast
$route(n) {
if (this.$store.state.app.token) {
// 浏览记录
diff --git a/components/productConSwiper/indexNew.vue b/components/productConSwiper/indexNew.vue
index fbecc63..27475a5 100644
--- a/components/productConSwiper/indexNew.vue
+++ b/components/productConSwiper/indexNew.vue
@@ -7,7 +7,7 @@
+ :enable-progress-gesture="false" :poster="item+coverUrl">
@@ -19,7 +19,7 @@
-
+
@@ -37,7 +37,7 @@
+ :poster="playingUrl+coverUrl" @pause="videoPause" @ended="endedFun()">
@@ -72,6 +72,7 @@
},
data() {
return {
+ coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
current: '0',
videoTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
playingUrl: '',
diff --git a/pages.json b/pages.json
index d254eb5..87b35fb 100644
--- a/pages.json
+++ b/pages.json
@@ -1366,7 +1366,15 @@
"navigationBarTitleText": "商品详情"
}
- }, {
+ },
+ {
+ "path": "goods_details/videoPlay",
+ "style": {
+ "navigationBarTitleText": "视屏详情"
+
+ }
+ },
+ {
"path": "stockOut/index",
"style": {
"navigationBarTitleText": "扫码出库",
diff --git a/pages/admin/goods_details/index.vue b/pages/admin/goods_details/index.vue
index 4d0229a..e12e7fc 100644
--- a/pages/admin/goods_details/index.vue
+++ b/pages/admin/goods_details/index.vue
@@ -181,9 +181,42 @@
+
+
+
+ ¥
+ {{storeInfo.price}}/瓶
+
+
+ {{storeInfo.store_name ? storeInfo.store_name : ''}}
+
+
+
+
+
+
+ 书海性sdsd
+
+
+ 阿萨德
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{attrTxt}}:
+ {{attrValue}}
+
+
+ 1件
+
+
+
+
+
+ 运费:
+ {{shippingValue}}
+
+
-
-
+
@@ -250,7 +296,7 @@
-
+
@@ -298,21 +344,16 @@
-
-
- {{item}}
-
-
+
+
+
+
-
+
-
@@ -370,6 +411,7 @@
data() {
let that = this;
return {
+ coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
show: false,
autoplay: false,
isPlay: false,
@@ -480,6 +522,13 @@
// this.getConfig()
},
methods: {
+ navGoPlay(url) {
+ console.log(url)
+ uni.navigateTo({
+ url: `/pages/admin/goods_details/videoPlay?url=${url}`
+ })
+
+ },
bindPause: function() {
this.show = true
console.log(this.isPlay, 'isplsfds')
@@ -1741,4 +1790,52 @@
// height: 750rpx;
}
}
+
+ .image-play-icon {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+
+ .card {
+ width: 710rpx;
+ margin: 20rpx auto;
+ background-color: white;
+ border-radius: 16rpx;
+ padding: 20rpx;
+ }
+
+ .attribute {
+ display: flex;
+ background-color: #F6F6F6;
+ // padding: 10rpx;
+ width: 670rpx;
+ height: 112rpx;
+ overflow-x: auto;
+ white-space: nowrap;
+ border-radius: 8rpx;
+ position: relative;
+ }
+
+ .attribute-li {
+ display: flex;
+ padding: 10rpx 0;
+ font-size: 24rpx;
+ align-items: center;
+ }
+
+ .attribute-fixed-right {
+ top: 0rpx;
+ position: sticky;
+ right: -30rpx;
+ height: 112rpx;
+ padding: 0;
+ width: 100rpx;
+ background: #F6F6F6;
+ box-shadow: -6rpx 0rpx 6rpx 2rpx rgba(220, 220, 220, 0.28);
+ border-radius: 0rpx 8rpx 8rpx 0rpx;
+ display: flex;
+ align-items: center;
+ }
\ No newline at end of file
diff --git a/pages/admin/goods_details/videoPlay.nvue b/pages/admin/goods_details/videoPlay.nvue
new file mode 100644
index 0000000..57c7b68
--- /dev/null
+++ b/pages/admin/goods_details/videoPlay.nvue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/product/addGood/addGood.vue b/pages/product/addGood/addGood.vue
index 79734d7..927058b 100644
--- a/pages/product/addGood/addGood.vue
+++ b/pages/product/addGood/addGood.vue
@@ -25,8 +25,12 @@
-
+
+
+
+
+
+
@@ -131,9 +135,6 @@
-
-
-
@@ -168,6 +169,7 @@
},
data() {
return {
+ coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
videoIndex: 0,
showVideo: false,
upload_max: 100,
@@ -197,6 +199,7 @@
],
selfAttr: "",
formData: {
+ store_info: "",
"store_name": "",
"imageList": [
@@ -641,4 +644,17 @@
/* position: absolute; */
}
+
+ .image-play-icon {
+ background-color: rgba(0, 0, 0, 0.3);
+ width: 140rpx;
+ height: 140rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ }
\ No newline at end of file
diff --git a/pages/product/addGoodDetail/addGoodDetail.vue b/pages/product/addGoodDetail/addGoodDetail.vue
index afa9a7d..2714c02 100644
--- a/pages/product/addGoodDetail/addGoodDetail.vue
+++ b/pages/product/addGoodDetail/addGoodDetail.vue
@@ -4,12 +4,12 @@
labelWidth='auto'>
- {{value1.length}}/{{maxLength}}
+ {{stroeNameLength}}/{{maxLength}}
-
@@ -20,6 +20,7 @@
+
@@ -28,8 +29,12 @@
-
+
+
+
+
+
+
@@ -41,9 +46,10 @@
+
+
-
-
+
+
+
+
+
+
@@ -107,9 +117,6 @@
-
-
-
商品类目属性
@@ -196,11 +203,11 @@
- 服务与承诺
+
- {{value1.length}}/{{300}}
+ {{storeInfoLength}}/{{300}}
@@ -295,6 +302,7 @@
},
data() {
return {
+ coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
mode: 'add',
isDetail: false,
columns: [
@@ -311,6 +319,7 @@
delivery_way: [],
isWholeSale: false,
formData: {
+ store_info: "",
product_id: "",
"store_name": "",
"imageList": [
@@ -494,6 +503,16 @@
switchVal: false
};
},
+
+ computed: {
+ stroeNameLength() {
+ return this.formData.store_name?.length || 0
+ },
+ storeInfoLength() {
+ return this.formData.store_info?.length || 0
+ }
+ },
+
methods: {
test(index) {
// this.formData.imageList.splice(index, 1)
@@ -715,6 +734,19 @@
})
},
+ oldToNew(formData) {
+ if (formData.attr.length <= 1) return
+ formData.attr.splice(1, 999)
+ formData.attr[0].value = ' '
+ formData.attr[0].detail = formData.attrValue.map(item => item.sku)
+ formData.attrValue.forEach(item => {
+ item.detail = {}
+ item.detail[' '] = item.sku
+ })
+ this.formData = formData
+ },
+
+
initFormData(option) {
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
this.mer_id = option.mer_id
@@ -725,7 +757,8 @@
let goods = JSON.parse(option.goodsInfo)
console.log(goods)
this.formData.store_name = goods.store_name
- this.formData.imageList = [goods.image, ...[goods.slider_image]]
+ this.formData.imageList = [goods.image, ...goods.slider_image]
+ console.log(this.formData)
}
}
},
@@ -749,6 +782,8 @@
this.formData.cate_id = this.formData.storeCategory.store_category_id
delete this.formData.image_list
if (!this.formData.imageList) this.formData.imageList = []
+ this.oldToNew(this.formData)
+ console.log(this.formData, 'formDATA')
})
}
},
@@ -894,4 +929,17 @@
/* position: absolute; */
}
+
+ .image-play-icon {
+ background-color: rgba(0, 0, 0, 0.3);
+ width: 140rpx;
+ height: 140rpx;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ }
\ No newline at end of file
diff --git a/pages/product/addGoodDetail/goodsAttr.vue b/pages/product/addGoodDetail/goodsAttr.vue
index 4f7593d..7dfab9e 100644
--- a/pages/product/addGoodDetail/goodsAttr.vue
+++ b/pages/product/addGoodDetail/goodsAttr.vue
@@ -355,7 +355,7 @@
},
submit() {
let that = this
- uni.reLaunch({
+ uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }`
})
diff --git a/pages/product/addGoodDetail/goodsPrice.vue b/pages/product/addGoodDetail/goodsPrice.vue
index 26fd1e3..d9fbf0a 100644
--- a/pages/product/addGoodDetail/goodsPrice.vue
+++ b/pages/product/addGoodDetail/goodsPrice.vue
@@ -21,9 +21,11 @@
/
-
+
+
+
+
@@ -32,8 +34,11 @@
/
-
+
+
+
+
@@ -163,7 +168,8 @@
unit_name: '计量单位不能为空',
wholesale_price: '批发价格不能为空',
wholesale_unit_name: '批发单位不能为空',
- stock: '库存不能为空'
+ stock: '库存不能为空',
+
}
@@ -188,13 +194,14 @@
this.showCustom = false
this.showPouple = false
},
-
+ // hide() {
+ // uni.hideKeyboard()
+ // },
unitIptClick(index, type) {
this.isWhose = type
- console.log(index)
this.unitIndex = index
this.showPouple = true
-
+ uni.hideKeyboard()
},
pushFn() {
this.attrValue.push({
@@ -238,23 +245,29 @@
errList.push(this.rules[key])
}
}
+ if (this.attrValue.length > 1) {
+ if (!item['sku']) {
+ errList.push('规格名称不能为空')
+ }
+ }
})
if (errList.length > 0) {
+ console.log(errList)
uni.$u.toast(errList[0])
return
}
- let flag = false
- if (this.formData.attr.length > 1) {
- this.formData.attr.forEach(item => {
- if (!item.value) {
- flag = true
- }
- })
- }
- if (flag) {
- uni.$u.toast('请填写规格名称')
- return
- }
+ // let flag = false
+ // if (this.formData.attr.length > 1) {
+ // this.formData.attr.forEach(item => {
+ // if (!item.value) {
+ // flag = true
+ // }
+ // })
+ // }
+ // if (flag) {
+ // uni.$u.toast('请填写规格名称')
+ // return
+ // }
// 校验结束
this.formData.attr[0].detail = []
this.attrValue.forEach(item => {
diff --git a/pages/product/list/index.vue b/pages/product/list/index.vue
index 45ee085..f7243bf 100644
--- a/pages/product/list/index.vue
+++ b/pages/product/list/index.vue
@@ -866,8 +866,8 @@
editGoods(item) {
let url = '/pages/product/addGoodDetail/addGoodDetail';
- if (this.mer_info.type_code == 'PersonalStore') url = '/pages/product/addGood/addGood_one';
- if (this.mer_info.type_code == 'TypeSupplyChain') url = '/pages/product/addGood/addGood_supply';
+ if (this.mer_info.type_code == 'PersonalStore') url = '/pages/product/addGoodDetail/addGoodDetail';
+ if (this.mer_info.type_code == 'TypeSupplyChain') url = '/pages/product/addGoodDetail/addGoodDetail';
navigateTo(1, url, {
mer_id: item.mer_id,
product_id: item.product_id
diff --git a/pages/product/updateStock/updateStock.vue b/pages/product/updateStock/updateStock.vue
index 4ee6f3f..bc4b857 100644
--- a/pages/product/updateStock/updateStock.vue
+++ b/pages/product/updateStock/updateStock.vue
@@ -2,9 +2,8 @@
-
-
+
+
点击预览