diff --git a/src/pageB/code/index.vue b/src/pageB/code/index.vue
index 3ff1573..639f219 100644
--- a/src/pageB/code/index.vue
+++ b/src/pageB/code/index.vue
@@ -1,6 +1,6 @@
-
+
请用户通过微信扫码进入小程序生成订单
门店管理
@@ -13,9 +13,12 @@
export default {
data() {
return {
-
+ image:''
};
},
+ onLoad({image}) {
+ this.image=image
+ },
methods:{
toBack(){
uni.navigateBack({
diff --git a/src/pageB/select_product/index.vue b/src/pageB/select_product/index.vue
index 9d41aba..98af9af 100644
--- a/src/pageB/select_product/index.vue
+++ b/src/pageB/select_product/index.vue
@@ -23,12 +23,12 @@
默认已提货量》
-
+
-
+
@@ -41,13 +41,13 @@
合计
{{totalPrice}}元
-
+
vip
{{vipPrice}}元
- 生成二维码
+
+ 生成二维码
@@ -57,6 +57,9 @@
请搜索您需要的商品
+
+
@@ -68,12 +71,13 @@
},
data() {
return {
- isShow:true,
+ modeShow: false,
+ isShow: true,
id: '',
keyword: '',
list: [], //搜索的商品
chooseList: [], //选择的商品
- goodItem:{},
+ goodItem: {},
};
},
onLoad({
@@ -81,19 +85,19 @@
}) {
this.id = id
},
- computed:{
+ computed: {
//普通价格合计
- totalPrice(){
- const total=this.chooseList.reduce((pr, cu)=>{
- return pr+cu.sell_price*cu.num
- },0)
+ totalPrice() {
+ const total = this.chooseList.reduce((pr, cu) => {
+ return pr + cu.sell_price * cu.num
+ }, 0)
return total
},
//会员价合计
- vipPrice(){
- const total=this.chooseList.reduce((pr, cu)=>{
- return pr+cu.vip_price*cu.num
- },0)
+ vipPrice() {
+ const total = this.chooseList.reduce((pr, cu) => {
+ return pr + cu.vip_price * cu.num
+ }, 0)
return total
}
},
@@ -108,32 +112,72 @@
if (this.list.length == 0) {
return this.$u.toast('暂未搜索到该商品')
}
- this.isShow=false
+ this.isShow = false
let goodsObj = resDate.data.length > 0 ? resDate.data[0] : {}
- goodsObj.defaultNum =1
+ goodsObj.defaultNum = 1
goodsObj.num = 1
this.goodItem = goodsObj
},
//添加商品
addGood(e) {
- const result=this.chooseList.findIndex(item=> item.id==e)
- if(result==-1){
+ const result = this.chooseList.findIndex(item => item.id == e)
+ if (result == -1) {
this.chooseList.unshift(this.goodItem)
- }else{
- const num= this.chooseList[result].num+1
- this.getUpdate(result,num)
+ } else {
+ const num = this.chooseList[result].num + 1
+ this.getUpdate(result, num)
}
},
//商品数量改变
- numChange(id,value){
- const Index= this.chooseList.findIndex(item=>item.id==id)
- this.getUpdate(Index,value)
+ numChange(id, value) {
+ const Index = this.chooseList.findIndex(item => item.id == id)
+ this.getUpdate(Index, value)
},
//刷新页面
- getUpdate(Index,val){
- this.chooseList[Index].num=val
- this.chooseList[Index].defaultNum=val
- this.chooseList=[...this.chooseList]
+ getUpdate(Index, val) {
+ this.chooseList[Index].num = val
+ this.chooseList[Index].defaultNum = val
+ this.chooseList = [...this.chooseList]
+ },
+ qrCode() {
+ if (this.chooseList.length == 0) {
+ return this.$u.toast('至少选选择一件商品')
+ }
+ this.modeShow = true
+ },
+ //生成二维码
+ async confirm() {
+ uni.showLoading({
+ title: '二维码生成中',
+ mask: true
+ });
+ try {
+ const arrList = this.chooseList.map(item => {
+ return {
+ sku_id: item.id,
+ quantity: item.num,
+ send: item.defaultNum
+ }
+ })
+ const obj = {
+ store_id: this.id,
+ products: arrList,
+ note: ''
+ }
+ const {
+ image
+ } = await this.$api.post(`/v1/order-pre`, obj);
+ this.$u.route('/pageB/code/index', {
+ image
+ })
+ this.keyword = ''
+ this.list = []
+ this.chooseList = []
+ this.goodItem = {}
+ this.isShow = true
+ } catch (err) {}finally{
+ uni.hideLoading()
+ }
}
}
}
diff --git a/src/pages/confirm_payment/confirm_payment.vue b/src/pages/confirm_payment/confirm_payment.vue
index 3c1bffb..43d004d 100644
--- a/src/pages/confirm_payment/confirm_payment.vue
+++ b/src/pages/confirm_payment/confirm_payment.vue
@@ -45,7 +45,7 @@
- -¥{{ discountCount }}
+ -¥{{ discountCount }}
合计: ¥{{ detail.total_amount }}
@@ -103,14 +103,14 @@ export default {
// name: '支付宝',
// pay_way: 'alipay',
// },
- {
- name: '可提',
- pay_way: 'wallet',
- },
- {
- name: '余额',
- pay_way: 'balance',
- },
+ // {
+ // name: '可提',
+ // pay_way: 'wallet',
+ // },
+ // {
+ // name: '余额',
+ // pay_way: 'balance',
+ // },
],
payWay: 'wxpay',
detail: {},
diff --git a/src/pages/me/me.vue b/src/pages/me/me.vue
index 4fec84d..ad819e7 100644
--- a/src/pages/me/me.vue
+++ b/src/pages/me/me.vue
@@ -360,8 +360,7 @@ export default {
},
//是否为店员
is_company(){
- // return this.user?.is_company??false
- return true
+ return this.user?.is_company??false
}
},
onShow() {
diff --git a/src/pages/order_details/index.vue b/src/pages/order_details/index.vue
index 4189b59..9db4c2d 100644
--- a/src/pages/order_details/index.vue
+++ b/src/pages/order_details/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -226,10 +226,9 @@ export default {
},
onLoad({ id }) {
this.id = id;
- // this.getDetail();
},
onShow() {
- this.getDetail();
+ this.getDetail();
},
computed: {
service() {
@@ -244,6 +243,18 @@ export default {
},
},
methods: {
+ //判断是否有页面栈,如果没有返回首页,否则返回上一页
+ goJump(){
+ const pages = getCurrentPages()
+ const prevPage = pages[pages.length - 2]
+ if(prevPage){
+ uni.navigateBack({})
+ }else{
+ uni.switchTab({
+ url:'/pages/index/index'
+ })
+ }
+ },
//复制
copy(val) {
uniCopy({
diff --git a/src/pages/welcome/index.vue b/src/pages/welcome/index.vue
index c740473..953c89f 100644
--- a/src/pages/welcome/index.vue
+++ b/src/pages/welcome/index.vue
@@ -1,25 +1,46 @@
-
+