完善小程序
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view style="height: 100vh;background: #fff;">
|
||||
<loading-state ref="pageView" @request="request">
|
||||
<view style="height: 100vh;overflow: hidden;overflow-y: auto;">
|
||||
<image :src="data.picUrl" style="width: 100vw;height: 80vw;" mode="scaleToFill"></image>
|
||||
<view style="height: 85vh;overflow: hidden;overflow-y: auto;">
|
||||
<image :src="data.picUrl" style="width: 100vw;height: 80vw;"></image>
|
||||
|
||||
<view style="display: flex;flex-direction: column;background: #fff;padding: 20px 20px 0px 20px;margin-top: 10px;
|
||||
border-top-left-radius: 20px;border-top-right-radius: 20px;height: 100%;">
|
||||
@@ -10,23 +10,23 @@
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;">
|
||||
<text
|
||||
style="font-size: 18px;font-weight: 600;font-family: sans-serif;color: #333;">{{data.name}}</text>
|
||||
<text style="font-size: 13px;color: #FF7A11;">¥{{data.price}}</text>
|
||||
<text style="font-size: 13px;color: #FF5006;">¥{{data.mefenPrice}}</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;margin-top: 10px;">
|
||||
<text style="font-size: 13px;color: #666;">单    价</text>
|
||||
<text
|
||||
style="font-size: 13px;color: #999;">{{data.weight}}{{data.specificationUnit}}/{{data.unitName}}</text>
|
||||
<text style="font-size: 13px;color: #666;">规    格</text>
|
||||
<text style="font-size: 13px;color: #999;">{{data.weight}}</text>
|
||||
</view>
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;margin-top: 10px;">
|
||||
<text style="font-size: 13px;color: #666;">规    格</text>
|
||||
<text style="font-size: 13px;color: #999;">{{data.remarks}}</text>
|
||||
<text style="font-size: 13px;color: #666;">包    装</text>
|
||||
<text
|
||||
style="font-size: 13px;color: #999;">{{data.quantityOfPackage}}{{data.unitName}}/{{data.packUnit}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 20px;">
|
||||
|
||||
<view style="width: 2px;height: 15px;background: #61CB29;margin-right: 10px;"></view>
|
||||
<view style="width: 2px;height: 15px;background: #FF7A11;margin-right: 10px;"></view>
|
||||
<text style="font-size: 14px;font-weight: 600;font-family: sans-serif;color: #333;">商品详情</text>
|
||||
|
||||
</view>
|
||||
@@ -40,7 +40,7 @@
|
||||
</view>
|
||||
</loading-state>
|
||||
|
||||
<!-- <view
|
||||
<!-- <view
|
||||
style="position: absolute; bottom: 0px; display: flex;flex-direction: column;width: 100%;
|
||||
box-sizing: border-box; padding-left: 16px;padding-right: 16px;background: #fff; height: 12vh;border-top: 1px solid #EFEFEF;"> -->
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view
|
||||
<!-- <view
|
||||
style="display: flex;flex-direction: row; justify-content: center;align-items: center;margin-top: 10px;padding: 0px 10px;margin-bottom: 20px;">
|
||||
|
||||
<text style="background: #FF9900; color: #fff;font-size: 14px; padding: 0px 15px;height: 50px;line-height:50px;flex: 1;text-align: center;
|
||||
@@ -89,8 +89,8 @@
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- </view> -->
|
||||
<!-- </view> -->
|
||||
<!-- </view>
|
||||
</view> -->
|
||||
|
||||
|
||||
<!-- 弹窗蒙版 -->
|
||||
@@ -337,9 +337,9 @@
|
||||
|
||||
_this.getAllPriceOrWeight()
|
||||
|
||||
// _this.$nextTick(() => {
|
||||
// _this.$refs.pageView.setLoadState(2)
|
||||
// })
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(2)
|
||||
})
|
||||
}).catch(e => {
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
@@ -348,33 +348,33 @@
|
||||
},
|
||||
|
||||
getAllPriceOrWeight() {
|
||||
let _this = this
|
||||
// let _this = this
|
||||
|
||||
var params = {
|
||||
customerSid: getApp().globalData.sid,
|
||||
brandId: _this.data.brandId,
|
||||
}
|
||||
// var params = {
|
||||
// customerSid: getApp().globalData.sid,
|
||||
// brandId: _this.data.brandId,
|
||||
// }
|
||||
|
||||
console.log("getGoodsWeight", params);
|
||||
// console.log("getGoodsWeight", params);
|
||||
|
||||
_this.$api.getGoodsWeight(params).then((resp) => {
|
||||
// _this.$api.getGoodsWeight(params).then((resp) => {
|
||||
|
||||
console.log("getGoodsWeight", resp);
|
||||
// console.log("getGoodsWeight", resp);
|
||||
|
||||
_this.page.price = resp.totalPrice
|
||||
_this.page.weight = resp.totalWeight
|
||||
_this.page.remarks = resp.remarks
|
||||
// _this.page.price = resp.totalPrice
|
||||
// _this.page.weight = resp.totalWeight
|
||||
// _this.page.remarks = resp.remarks
|
||||
|
||||
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(2)
|
||||
})
|
||||
// _this.$nextTick(() => {
|
||||
// _this.$refs.pageView.setLoadState(2)
|
||||
// })
|
||||
|
||||
}).catch(e => {
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.pageView.setLoadState(1)
|
||||
})
|
||||
})
|
||||
// }).catch(e => {
|
||||
// _this.$nextTick(() => {
|
||||
// _this.$refs.pageView.setLoadState(1)
|
||||
// })
|
||||
// })
|
||||
},
|
||||
|
||||
inCart() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view style="height: 100vh;background: #fff;">
|
||||
<loading-state ref="pageView" @request="request">
|
||||
<view style="height: 100vh;overflow: hidden;overflow-y: auto;">
|
||||
<image :src="data.picUrl" style="width: 100vw;height: 80vw;" mode="aspectFill"></image>
|
||||
<image :src="data.picUrl" style="width: 100vw;height: 80vw;"></image>
|
||||
|
||||
<view style="display: flex;flex-direction: column;background: #fff;padding: 20px 20px 0px 20px;margin-top: 10px;
|
||||
border-top-left-radius: 20px;border-top-right-radius: 20px;height: 100%;">
|
||||
@@ -10,19 +10,20 @@
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;">
|
||||
<text
|
||||
style="font-size: 18px;font-weight: 600;font-family: sans-serif;color: #333;">{{data.name}}</text>
|
||||
<text style="font-size: 13px;color: #FF7A11;">¥{{data.price}}</text>
|
||||
<text style="font-size: 13px;color: #FF5006;">¥{{data.mefenPrice}}</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;margin-top: 10px;">
|
||||
<text style="font-size: 13px;color: #666;">单    价</text>
|
||||
<text
|
||||
style="font-size: 13px;color: #999;">{{data.weight}}{{data.specificationUnit}}/{{data.unitName}}</text>
|
||||
<text style="font-size: 13px;color: #666;">规    格</text>
|
||||
<text style="font-size: 13px;color: #999;">{{data.weight}}</text>
|
||||
</view>
|
||||
<view style="display: flex;flex-direction: row;justify-content: space-between;margin-top: 10px;">
|
||||
<text style="font-size: 13px;color: #666;">规    格</text>
|
||||
<text style="font-size: 13px;color: #999;">{{data.remarks}}</text>
|
||||
<text style="font-size: 13px;color: #666;">包    装</text>
|
||||
<text
|
||||
style="font-size: 13px;color: #999;">{{data.quantityOfPackage}}{{data.unitName}}/{{data.packUnit}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 20px;">
|
||||
|
||||
<view style="width: 2px;height: 15px;background: #FF7A11;margin-right: 10px;"></view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view style="width: 100%;height: 100%;background: #60CA2C;display: flex;flex-direction: column;">
|
||||
<view style="width: 100%;height: 100%;background: #FFA35A;display: flex;flex-direction: column;">
|
||||
|
||||
<NavBar ref="nav" navTitle="预约提货" :showIcon="true" :supportChange="false">
|
||||
</NavBar>
|
||||
@@ -134,9 +134,11 @@
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
|
||||
<text style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;
|
||||
font-size: 10px;color: #EE752F;">{{item.weight}}</text>
|
||||
<text
|
||||
style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;
|
||||
font-size: 10px;color: #EE752F; margin-right: 10px; ">{{item.weight}}{{item.specificationUnit}}/{{item.unitName}}</text>
|
||||
style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;margin-left: 10px;
|
||||
font-size: 10px;color: #EE752F;">{{item.quantityOfPackage}}{{item.unitName}}/{{item.specificationUnit}}</text>
|
||||
|
||||
<text
|
||||
style="border: 1px #EE752F solid; background: #FF9900; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
@@ -192,7 +194,7 @@
|
||||
|
||||
<view
|
||||
style="position: fixed;bottom: 0; width: 100%; box-sizing: border-box; padding-left: 10vw;padding-right: 10vw;display: flex;flex-direction: row; justify-content: center;align-items: center;">
|
||||
<text style=" background: #60CA2C;color: #fff;margin-bottom: 20px; border-radius: 20px;
|
||||
<text style=" background: #FF9900;color: #fff;margin-bottom: 20px; border-radius: 20px;
|
||||
padding-top: 10px;padding-bottom: 10px;padding-left: 25vw;padding-right: 25vw; text-align: center;"
|
||||
@click="congirmExtract()">确认提货</text>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view style="width: 100%;height: 100%;background: #60CA2C;display: flex;flex-direction: column;">
|
||||
<view style="width: 100%;height: 100%;background: #FFA35A;display: flex;flex-direction: column;">
|
||||
|
||||
<!-- <NavBar ref="nav" navTitle="转赠亲友" :showIcon="true" :supportChange="false">
|
||||
</NavBar> -->
|
||||
@@ -259,7 +259,549 @@
|
||||
|
||||
<style>
|
||||
button {
|
||||
background: #60CA2C;
|
||||
background: #FF9900;
|
||||
color: #fff;
|
||||
margin-top: 20px;
|
||||
height: 40px;
|
||||
width: 80%;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style><template>
|
||||
<view style="width: 100%;height: 100%;background: #FFA35A;display: flex;flex-direction: column;">
|
||||
|
||||
<!-- <NavBar ref="nav" navTitle="转赠亲友" :showIcon="true" :supportChange="false">
|
||||
</NavBar> -->
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: column;background: #f7f7f7;padding: 10px;border-radius: 15px; height: 100vh;width: 100%; box-sizing: border-box;">
|
||||
|
||||
<scroll-view scroll-y="true" style="height: calc(100vh - 150px); width: 100%; background: #fff;padding: 10px; box-sizing: border-box;
|
||||
" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
|
||||
<view v-for="(item,index) in pickingUpGoods"
|
||||
style=" display: flex;flex-direction: row;margin-top: 15px; margin-bottom: 10px;">
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;width: 100%; ">
|
||||
|
||||
<image :src="item.iconUrl" style="width: 90px;height: 90px; border-radius: 10px; "
|
||||
mode="aspectFill" @click="itemClick(item.goodsSid)"></image>
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
|
||||
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
|
||||
|
||||
<text style="font-size: 14px;color: #000; font-weight: 600;"
|
||||
@click="itemClick(item.goodsSid)">{{item.name}}</text>
|
||||
|
||||
<text style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
|
||||
<text style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;
|
||||
font-size: 10px;color: #EE752F;">{{item.weight}}{{item.specificationUnit}}/{{item.unitName}}</text>
|
||||
|
||||
<text
|
||||
style="border: 1px #EE752F solid; background: #FF9900;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='0'">百姓菜!</text>
|
||||
<text
|
||||
style="border: 1px #3AA15F solid; background: #40C772;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='1'">精品菜!</text>
|
||||
<text
|
||||
style="border: 1px #1D60C7 solid; background: #2489F7;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='2'">企业菜!</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between; margin-top: 15px;
|
||||
margin-right: 15px;">
|
||||
<view style="display: flex;flex-direction: row;align-items: center;">
|
||||
<text style="font-size: 10px;color: #FF5006;">存量:</text>
|
||||
<text
|
||||
style="font-size: 14px;color: #FF5006;">{{item.goodsNumber}}{{item.unitName}}</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;">
|
||||
|
||||
<image src="../../static/jian_icon.png" mode="aspectFill"
|
||||
style="width: 20px;height: 20px;" @click.stop="jian(item)"></image>
|
||||
|
||||
<text
|
||||
style="font-size: 14px;margin-left: 8px;margin-right: 8px;">{{item.count}}</text>
|
||||
<image src="../../static/jia_icon.png" mode="aspectFill"
|
||||
style="width: 20px;height: 20px;" @click.stop="jia(item)"></image>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="transferNotData"
|
||||
style="display: flex;flex-direction: column;justify-content: center;align-items: center;margin-top: 5vw;">
|
||||
|
||||
<image src="https://supervise.yxtsoft.com/lpk/image/supplementing.png" mode="aspectFit"
|
||||
style="width: 50vw;height: 50vw;"></image>
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: -15px;">
|
||||
<text style=" border-radius: 8px; padding: 3px 8px; color: #999;">没有商品咯,请添加~</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view style="position: fixed;bottom: 0;display: flex;flex-direction: column;
|
||||
border-top: 1px solid #f7f7f7;
|
||||
justify-content: center;background: #fff; width: 100%;box-sizing:border-box;">
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;
|
||||
padding-left: 15px;padding-right: 15px;">
|
||||
<text style="font-size: 14px;margin-right: 10px;font-weight: 600;">转赠留言</text>
|
||||
<input placeholder="可以写下您对亲友的祝福"
|
||||
style="font-size: 30rpx;flex: 1;background: #F2F2F2;border-radius: 5px;height: 40px;line-height: 40px;padding-left: 10px;padding-right: 10px;"
|
||||
:value="transferInfo.remarks" @input="onKeyInput" />
|
||||
</view>
|
||||
|
||||
<button open-type="share" :disabled="transferNotData">确认</button>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
affiliation: "",
|
||||
transferNotData: false,
|
||||
transferInfo: {
|
||||
|
||||
},
|
||||
pickingUpGoods: [],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
|
||||
this.pickingUpGoods = JSON.parse(decodeURIComponent(options.pickingUpGoods))
|
||||
this.affiliation = options.affiliation
|
||||
|
||||
console.log(">>>>>", options);
|
||||
console.log(">>>>>", this.pickingUpGoods);
|
||||
console.log(">>>>>", this.affiliation);
|
||||
|
||||
},
|
||||
onPageScroll(res) {
|
||||
// 渐变
|
||||
this.$refs.nav.defaultColorBgAlpha(res)
|
||||
},
|
||||
methods: {
|
||||
itemClick(goodsSid) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/good/goodsDetail?sid=' + goodsSid
|
||||
})
|
||||
},
|
||||
onKeyInput(event) {
|
||||
this.transferInfo.remarks = event.target.value
|
||||
},
|
||||
jian(item) {
|
||||
console.log("item》》》》", item)
|
||||
const that = this
|
||||
if (Number(item.count) == 1) {
|
||||
|
||||
wx.showModal({
|
||||
content: '确定不要了吗',
|
||||
cancelText: "再想想",
|
||||
confirmText: "删除",
|
||||
confirmColor: "#FF9900",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
item.count = 0
|
||||
const index = that.pickingUpGoods.findIndex((info) => info.goodsSid === item
|
||||
.goodsSid)
|
||||
console.log("index》》》》", index)
|
||||
that.pickingUpGoods.splice(index, 1)
|
||||
|
||||
that.transferNotData = that.pickingUpGoods.length == 0
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
if (Number(item.count) > 0) {
|
||||
item.count = Number(item.count) - 1
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
jia(item) {
|
||||
if (item.count < item.goodsNumber)
|
||||
item.count = Number(item.count) + 1
|
||||
},
|
||||
|
||||
onShareAppMessage: function(res) {
|
||||
|
||||
let _this = this
|
||||
const promise = new Promise(resolve => {
|
||||
// 模拟网络请求
|
||||
setTimeout(() => {
|
||||
|
||||
var list = []
|
||||
for (var i = 0; i < this.pickingUpGoods.length; i++) {
|
||||
var item = this.pickingUpGoods[i]
|
||||
|
||||
if (item.count > 0) {
|
||||
list.push({
|
||||
goodsSid: item.goodsSid,
|
||||
select: item.count
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var params = {
|
||||
customerSid: getApp().globalData.sid,
|
||||
brandId: _this.affiliation,
|
||||
remarks: _this.transferInfo.remarks,
|
||||
vos: list
|
||||
}
|
||||
|
||||
// console.log("=========0", params);
|
||||
|
||||
_this.$api.transSubmission(params).then((resp) => {
|
||||
uni.navigateBack()
|
||||
// console.log("=========", resp);
|
||||
|
||||
let shareData = JSON.stringify({
|
||||
params: {
|
||||
code: resp.transferCode,
|
||||
codeKey: resp.sid
|
||||
},
|
||||
functionName: 'bindCard',
|
||||
url: '/pages/bind/bind_cloudCard?code=' + resp
|
||||
.transferCode + "&codeKey=" + resp.sid
|
||||
|
||||
// url: '/pages/home/cloudCard2?shareSid=' + getApp().globalData.sid,
|
||||
// functionName: 'share'
|
||||
})
|
||||
// 转码传输
|
||||
let value = encodeURIComponent(shareData)
|
||||
|
||||
resolve({
|
||||
title: '汇融农链-云菜窖',
|
||||
// ②
|
||||
path: '/pages/login/login?data=' + value,
|
||||
imageUrl: 'https://supervise.yxtsoft.com/lpk/image/share_transfer.png', //自定义图片路径,显示图片长宽比是 5:4。
|
||||
|
||||
})
|
||||
|
||||
}).catch(e => {
|
||||
_this.shortToast('发生错误,请稍后再试.')
|
||||
return
|
||||
})
|
||||
|
||||
}, 0)
|
||||
})
|
||||
|
||||
return promise
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
button {
|
||||
background: #FF9900;
|
||||
color: #fff;
|
||||
margin-top: 20px;
|
||||
height: 40px;
|
||||
width: 80%;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style><template>
|
||||
<view style="width: 100%;height: 100%;background: #FFA35A;display: flex;flex-direction: column;">
|
||||
|
||||
<!-- <NavBar ref="nav" navTitle="转赠亲友" :showIcon="true" :supportChange="false">
|
||||
</NavBar> -->
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: column;background: #f7f7f7;padding: 10px;border-radius: 15px; height: 100vh;width: 100%; box-sizing: border-box;">
|
||||
|
||||
<scroll-view scroll-y="true" style="height: calc(100vh - 150px); width: 100%; background: #fff;padding: 10px; box-sizing: border-box;
|
||||
" bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
|
||||
<view v-for="(item,index) in pickingUpGoods"
|
||||
style=" display: flex;flex-direction: row;margin-top: 15px; margin-bottom: 10px;">
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;width: 100%; ">
|
||||
|
||||
<image :src="item.iconUrl" style="width: 90px;height: 90px; border-radius: 10px; "
|
||||
mode="aspectFill" @click="itemClick(item.goodsSid)"></image>
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: column;flex: 1; padding-bottom: 15px; margin-left: 10px;"
|
||||
:style="{'border-bottom':(index == goods.length-1 ? 'none' : '1px #EFEFEF solid')}">
|
||||
|
||||
<text style="font-size: 14px;color: #000; font-weight: 600;"
|
||||
@click="itemClick(item.goodsSid)">{{item.name}}</text>
|
||||
|
||||
<text style="font-size: 10px;color: #999;margin-top: 5px;">{{item.remark}}</text>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 8px;">
|
||||
<text style="border: 1px #EE752F solid; border-radius: 5px; padding: 0px 8px;
|
||||
font-size: 10px;color: #EE752F;">{{item.weight}}{{item.specificationUnit}}/{{item.unitName}}</text>
|
||||
|
||||
<text
|
||||
style="border: 1px #EE752F solid; background: #FF9900;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='0'">百姓菜!</text>
|
||||
<text
|
||||
style="border: 1px #3AA15F solid; background: #40C772;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='1'">精品菜!</text>
|
||||
<text
|
||||
style="border: 1px #1D60C7 solid; background: #2489F7;margin-left: 10px; color: #fff; font-size: 10px;border-radius: 5px; padding: 0px 8px;"
|
||||
v-if="item.type=='2'">企业菜!</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between; margin-top: 15px;
|
||||
margin-right: 15px;">
|
||||
<view style="display: flex;flex-direction: row;align-items: center;">
|
||||
<text style="font-size: 10px;color: #FF5006;">存量:</text>
|
||||
<text
|
||||
style="font-size: 14px;color: #FF5006;">{{item.goodsNumber}}{{item.unitName}}</text>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;align-items: center;">
|
||||
|
||||
<image src="../../static/jian_icon.png" mode="aspectFill"
|
||||
style="width: 20px;height: 20px;" @click.stop="jian(item)"></image>
|
||||
|
||||
<text
|
||||
style="font-size: 14px;margin-left: 8px;margin-right: 8px;">{{item.count}}</text>
|
||||
<image src="../../static/jia_icon.png" mode="aspectFill"
|
||||
style="width: 20px;height: 20px;" @click.stop="jia(item)"></image>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="transferNotData"
|
||||
style="display: flex;flex-direction: column;justify-content: center;align-items: center;margin-top: 5vw;">
|
||||
|
||||
<image src="https://supervise.yxtsoft.com/lpk/image/supplementing.png" mode="aspectFit"
|
||||
style="width: 50vw;height: 50vw;"></image>
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: -15px;">
|
||||
<text style=" border-radius: 8px; padding: 3px 8px; color: #999;">没有商品咯,请添加~</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view style="position: fixed;bottom: 0;display: flex;flex-direction: column;
|
||||
border-top: 1px solid #f7f7f7;
|
||||
justify-content: center;background: #fff; width: 100%;box-sizing:border-box;">
|
||||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 15px;
|
||||
padding-left: 15px;padding-right: 15px;">
|
||||
<text style="font-size: 14px;margin-right: 10px;font-weight: 600;">转赠留言</text>
|
||||
<input placeholder="可以写下您对亲友的祝福"
|
||||
style="font-size: 30rpx;flex: 1;background: #F2F2F2;border-radius: 5px;height: 40px;line-height: 40px;padding-left: 10px;padding-right: 10px;"
|
||||
:value="transferInfo.remarks" @input="onKeyInput" />
|
||||
</view>
|
||||
|
||||
<button open-type="share" :disabled="transferNotData">确认</button>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
affiliation: "",
|
||||
transferNotData: false,
|
||||
transferInfo: {
|
||||
|
||||
},
|
||||
pickingUpGoods: [],
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
|
||||
this.pickingUpGoods = JSON.parse(decodeURIComponent(options.pickingUpGoods))
|
||||
this.affiliation = options.affiliation
|
||||
|
||||
console.log(">>>>>", options);
|
||||
console.log(">>>>>", this.pickingUpGoods);
|
||||
console.log(">>>>>", this.affiliation);
|
||||
|
||||
},
|
||||
onPageScroll(res) {
|
||||
// 渐变
|
||||
this.$refs.nav.defaultColorBgAlpha(res)
|
||||
},
|
||||
methods: {
|
||||
itemClick(goodsSid) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/good/goodsDetail?sid=' + goodsSid
|
||||
})
|
||||
},
|
||||
onKeyInput(event) {
|
||||
this.transferInfo.remarks = event.target.value
|
||||
},
|
||||
jian(item) {
|
||||
console.log("item》》》》", item)
|
||||
const that = this
|
||||
if (Number(item.count) == 1) {
|
||||
|
||||
wx.showModal({
|
||||
content: '确定不要了吗',
|
||||
cancelText: "再想想",
|
||||
confirmText: "删除",
|
||||
confirmColor: "#FF9900",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
item.count = 0
|
||||
const index = that.pickingUpGoods.findIndex((info) => info.goodsSid === item
|
||||
.goodsSid)
|
||||
console.log("index》》》》", index)
|
||||
that.pickingUpGoods.splice(index, 1)
|
||||
|
||||
that.transferNotData = that.pickingUpGoods.length == 0
|
||||
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
if (Number(item.count) > 0) {
|
||||
item.count = Number(item.count) - 1
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
jia(item) {
|
||||
if (item.count < item.goodsNumber)
|
||||
item.count = Number(item.count) + 1
|
||||
},
|
||||
|
||||
onShareAppMessage: function(res) {
|
||||
|
||||
let _this = this
|
||||
const promise = new Promise(resolve => {
|
||||
// 模拟网络请求
|
||||
setTimeout(() => {
|
||||
|
||||
var list = []
|
||||
for (var i = 0; i < this.pickingUpGoods.length; i++) {
|
||||
var item = this.pickingUpGoods[i]
|
||||
|
||||
if (item.count > 0) {
|
||||
list.push({
|
||||
goodsSid: item.goodsSid,
|
||||
select: item.count
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var params = {
|
||||
customerSid: getApp().globalData.sid,
|
||||
brandId: _this.affiliation,
|
||||
remarks: _this.transferInfo.remarks,
|
||||
vos: list
|
||||
}
|
||||
|
||||
// console.log("=========0", params);
|
||||
|
||||
_this.$api.transSubmission(params).then((resp) => {
|
||||
uni.navigateBack()
|
||||
// console.log("=========", resp);
|
||||
|
||||
let shareData = JSON.stringify({
|
||||
params: {
|
||||
code: resp.transferCode,
|
||||
codeKey: resp.sid
|
||||
},
|
||||
functionName: 'bindCard',
|
||||
url: '/pages/bind/bind_cloudCard?code=' + resp
|
||||
.transferCode + "&codeKey=" + resp.sid
|
||||
|
||||
// url: '/pages/home/cloudCard2?shareSid=' + getApp().globalData.sid,
|
||||
// functionName: 'share'
|
||||
})
|
||||
// 转码传输
|
||||
let value = encodeURIComponent(shareData)
|
||||
|
||||
resolve({
|
||||
title: '汇融农链-云菜窖',
|
||||
// ②
|
||||
path: '/pages/login/login?data=' + value,
|
||||
imageUrl: 'https://supervise.yxtsoft.com/lpk/image/share_transfer.png', //自定义图片路径,显示图片长宽比是 5:4。
|
||||
|
||||
})
|
||||
|
||||
}).catch(e => {
|
||||
_this.shortToast('发生错误,请稍后再试.')
|
||||
return
|
||||
})
|
||||
|
||||
}, 0)
|
||||
})
|
||||
|
||||
return promise
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
button {
|
||||
background: #FF9900;
|
||||
color: #fff;
|
||||
margin-top: 20px;
|
||||
height: 40px;
|
||||
|
||||
Reference in New Issue
Block a user