|  |  |  | 
|---|
|  |  |  | import storage from '@/plugins/storage.js' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | onLaunch: function(options) { | 
|---|
|  |  |  | onLaunch: async function(options) { | 
|---|
|  |  |  | var query = options.q && decodeURIComponent(options.q) || '' | 
|---|
|  |  |  | var querydto = {} | 
|---|
|  |  |  | if (query) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // #ifdef MP | 
|---|
|  |  |  | if (true && storage.getItem('token')) { | 
|---|
|  |  |  | if (true && storage.getItem('token')) { | 
|---|
|  |  |  | const res = await this.$store.dispatch('getCurrentInfo'); | 
|---|
|  |  |  | setTimeout(async () => { | 
|---|
|  |  |  | const res = await this.$store.dispatch('getCurrentInfo'); | 
|---|
|  |  |  | // #ifndef PUB_CUSTOMER | 
|---|
|  |  |  | if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) { | 
|---|
|  |  |  | if (this.currentInfo.type === 'admin') { | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" v-if="apitype!=='loginAdmin'" @click="toReg">前往注册</view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- #ifdef PUB_CUSTOMER --> | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" @click="toHome">返回首页</view> | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" @click="toHome" v-if="!source">返回首页</view> | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" @click="backpage" v-if="source==='jump'">返回上一页</view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- #endif --> | 
|---|
|  |  |  | <!-- #ifdef PUB_PARTNER --> | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" @click="()=>{ | 
|---|
|  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | async onLoad(options) { | 
|---|
|  |  |  | this.source = options.source || '' | 
|---|
|  |  |  | this.sharePartnerUserId = options.sharePartnerUserId || '' | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | var query = options.q && decodeURIComponent(options.q) || '' | 
|---|
|  |  |  | var querydto = {} | 
|---|
|  |  |  | 
|---|
|  |  |  | } catch (e) { | 
|---|
|  |  |  | console.error('error', e) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if (!querydto.partnerUserId) { | 
|---|
|  |  |  | if (options.query && options.query.scene) { | 
|---|
|  |  |  | //说明是特殊小程序二维码扫码跳转的 | 
|---|
|  |  |  | var keyvalues = decodeURIComponent(options.query.scene).split("&") | 
|---|
|  |  |  | for (var item of keyvalues) { | 
|---|
|  |  |  | var tarr = item.split("=") | 
|---|
|  |  |  | querydto[tarr[0]] = tarr[1] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (e) { | 
|---|
|  |  |  | console.error('error2', e) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if (!querydto.partnerUserId) { | 
|---|
|  |  |  | if (options.query && options.query.scene) { | 
|---|
|  |  |  | //说明是特殊小程序二维码扫码跳转的 | 
|---|
|  |  |  | var keyvalues = decodeURIComponent(options.query.scene).split("&") | 
|---|
|  |  |  | for (var item of keyvalues) { | 
|---|
|  |  |  | var tarr = item.split("=") | 
|---|
|  |  |  | querydto[tarr[0]] = tarr[1] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (e) { | 
|---|
|  |  |  | console.error('error2', e) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //退出登录了,或者失效了 | 
|---|
|  |  |  | // uni.navigateTo({ | 
|---|
|  |  |  | //     url: `/sub_pages/customer/customer-info/customer-info?source=step&partnerUserId=${querydto.partnerUserId}&partnerUserName=${querydto.partnerUserName}` | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | if (!querydto.partnerUserName) { | 
|---|
|  |  |  | tmp.$message.showLoading() | 
|---|
|  |  |  | const resname = await tmp.$http.request('get', '/api/customer/partner/name', { | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: querydto.partnerUserId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | tmp.$message.hideLoading() | 
|---|
|  |  |  | if (resname.code == 0) { | 
|---|
|  |  |  | querydto.partnerUserName = resname.data || '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | if (!querydto.partnerUserName) { | 
|---|
|  |  |  | tmp.$message.showLoading() | 
|---|
|  |  |  | const resname = await tmp.$http.request('get', | 
|---|
|  |  |  | '/api/customer/partner/name', { | 
|---|
|  |  |  | params: { | 
|---|
|  |  |  | id: querydto.partnerUserId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | tmp.$message.hideLoading() | 
|---|
|  |  |  | if (resname.code == 0) { | 
|---|
|  |  |  | querydto.partnerUserName = resname.data || '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/login/supplier-reg?partnerUserId=${querydto.partnerUserId}&partnerUserName=${querydto.partnerUserName}` | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | phoneNumber: '', | 
|---|
|  |  |  | smsCode: '', | 
|---|
|  |  |  | source: '', //来源 | 
|---|
|  |  |  | sharePartnerUserId: '', //分享跳转登录的id | 
|---|
|  |  |  |  | 
|---|
|  |  |  | checked: false, | 
|---|
|  |  |  | loginType: 'pwd', //pwd和code,密码和验证码登录 | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.redirectTo({ | 
|---|
|  |  |  | url: '/pages/login/supplier-reg' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // todo 如果是有分享id的,可能需要提前进行绑定 | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeAll(e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | //     uni.navigateBack(); | 
|---|
|  |  |  | // }, 1000); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //todo 登录后可能需要进行绑定 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // uni.showToast({ | 
|---|
|  |  |  | //     title: '登录失败!', | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- #ifdef PUB_CUSTOMER --> | 
|---|
|  |  |  | <!-- v-if="source==='step'" --> | 
|---|
|  |  |  | <view class="topic-font m-l-0 m-r-a" @click="scanPartnerCode">扫码绑定合伙人 | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- <view class="topic-font m-l-0 m-r-a" @click="scanPartnerCode">扫码绑定合伙人 | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <!-- #endif --> | 
|---|
|  |  |  | <view class="topic-font m-l-a m-r-0" @click="toLogin">前往登录</view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.scanCode({ | 
|---|
|  |  |  | success: async function(res) { | 
|---|
|  |  |  | console.log('条码内容:' + res.result); | 
|---|
|  |  |  | if (!res.result) { | 
|---|
|  |  |  | that.$message.showToast('未识别出信息,如果是微信小程序二维码,请微信扫码打开') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var dto = undefined | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if (res.result && (res.result.startsWith('http://') || res.result.startsWith( | 
|---|
|  |  |  | 
|---|
|  |  |  | order_pendding_num: 0, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifndef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifndef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | onShow() { | 
|---|
|  |  |  | this.getTj() | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.scanCode({ | 
|---|
|  |  |  | success: async function(res) { | 
|---|
|  |  |  | console.log('条码内容:' + res.result); | 
|---|
|  |  |  | if (!res.result) { | 
|---|
|  |  |  | that.$message.showToast('未识别出合伙人信息,如果是微信小程序二维码,请微信扫码打开') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var dto = undefined | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if (res.result && (res.result.startsWith('https://')||res.result.startsWith('http://')) && res.result.indexOf( | 
|---|
|  |  |  | if (res.result && (res.result.startsWith('https://') || res.result.startsWith( | 
|---|
|  |  |  | 'http://')) && res.result.indexOf( | 
|---|
|  |  |  | 'partnerUserId') >= 0) { | 
|---|
|  |  |  | var arr = res.result.split("?")[1].split("&") | 
|---|
|  |  |  | var arr = res.result.split("?")[1].split("&") | 
|---|
|  |  |  | dto = {} | 
|---|
|  |  |  | for (var item of arr) { | 
|---|
|  |  |  | var tarr = item.split("=") | 
|---|
|  |  |  | var tarr = item.split("=") | 
|---|
|  |  |  | // console.log('tarr',tarr) | 
|---|
|  |  |  | if (tarr[1]) { | 
|---|
|  |  |  | dto[tarr[0]] = tarr[1] | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | that.$message.showToast('二维码格式不正确扫码失败') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (e) { | 
|---|
|  |  |  | console.log('e',e) | 
|---|
|  |  |  | } catch (e) { | 
|---|
|  |  |  | console.log('e', e) | 
|---|
|  |  |  | that.$message.showToast('二维码扫码错误') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | id: '', | 
|---|
|  |  |  | dto: {}, | 
|---|
|  |  |  | shopnum: 0, | 
|---|
|  |  |  | sharePartnerUserId: '', | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShow() { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.refreshShopNum() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad(options) { | 
|---|
|  |  |  | console.log('trade detail options', options) | 
|---|
|  |  |  | this.id = options.id || '' | 
|---|
|  |  |  | if (this.id) { | 
|---|
|  |  |  | this.getDetail() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.refreshShopNum() | 
|---|
|  |  |  | if (options.partnerUserId) { | 
|---|
|  |  |  | //合伙人绑定的,判断当前用户,是否有登录 | 
|---|
|  |  |  | this.sharePartnerUserId = options.partnerUserId | 
|---|
|  |  |  | // let tmp = this | 
|---|
|  |  |  | // setTimeout(() => { | 
|---|
|  |  |  | //     if (!tmp.currentInfo.id) { | 
|---|
|  |  |  | //         //前往登录,,但是带上 | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // }, 500) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | //如果是合伙人的id,那么分享出去,需要附加id了 | 
|---|
|  |  |  | console.log('onShareAppMessage', this.currentInfo) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var partnerUserId = '' | 
|---|
|  |  |  | if (that.currentInfo.partnerDTO && currentInfo.partnerDTO.id) { | 
|---|
|  |  |  | partnerUserId = this.currentInfo.id | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/detail?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | `/sub_pages/customer/trade/detail?partnerUserId=${partnerUserId}&id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : "花满芫", | 
|---|
|  |  |  | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : | 
|---|
|  |  |  | "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | //如果是合伙人的id,那么分享出去,需要附加id了 | 
|---|
|  |  |  | var partnerUserId = '' | 
|---|
|  |  |  | if (that.currentInfo.partnerDTO && currentInfo.partnerDTO.id) { | 
|---|
|  |  |  | partnerUserId = this.currentInfo.id | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/detail?id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | `/sub_pages/customer/trade/detail?partnerUserId=${partnerUserId}&id=${this.id}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : "花满芫", | 
|---|
|  |  |  | title: this.dto.id ? (this.dto.name + " " + (this.dto.price || '-') + '元/扎 ' + (this.dto.unit || '')) : | 
|---|
|  |  |  | "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | async addnum(item, addnum) { | 
|---|
|  |  |  | if (!this.currentInfo.id) { | 
|---|
|  |  |  | await this.$message.confirm('请前往登录') | 
|---|
|  |  |  | // await this.$message.confirm('请前往登录') | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/pages/user/supplier-user' | 
|---|
|  |  |  | url: `/pages/login/supplier-login?source=jump&sharePartnerUserId=${this.sharePartnerUserId}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | async collectItem(dto) { | 
|---|
|  |  |  | if (!this.currentInfo.id) { | 
|---|
|  |  |  | this.$message.showToast('请先登录') | 
|---|
|  |  |  | // this.$message.showToast('请先登录') | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/login/supplier-login?source=jump&sharePartnerUserId=${this.sharePartnerUserId}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | await this.$message.confirm(`是否${dto.collection?'移除':'添加到'}收藏`) | 
|---|
|  |  |  | 
|---|
|  |  |  | async submitShopping(dto) { | 
|---|
|  |  |  | //提交到购物车中 | 
|---|
|  |  |  | // this.$message.showLoading() | 
|---|
|  |  |  | if (!this.currentInfo.id) { | 
|---|
|  |  |  | // this.$message.showToast('请先登录') | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/login/supplier-login?source=jump&sharePartnerUserId=${this.sharePartnerUserId}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | code, | 
|---|
|  |  |  | data | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | toShopping() { | 
|---|
|  |  |  | if (!this.currentInfo.id) { | 
|---|
|  |  |  | // this.$message.showToast('请先登录') | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages/login/supplier-login?source=jump&sharePartnerUserId=${this.sharePartnerUserId}` | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/sub_pages/customer/shopping/shopping' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <!-- 查询条件 --> | 
|---|
|  |  |  | <view class="component-filter-container"> | 
|---|
|  |  |  | <view class="flex1" @click.stop="order_show=true"> | 
|---|
|  |  |  | <!-- order_show=true --> | 
|---|
|  |  |  | <view class="flex1" @click.stop="$refs.popup_column.open()"> | 
|---|
|  |  |  | 排序{{ query.columnStr&&('-'+query.columnStr) || '' }} | 
|---|
|  |  |  | <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="flex1" @click.stop="level_show=true"> | 
|---|
|  |  |  | <view class="flex1" @click.stop="$refs.popup_level.open()"> | 
|---|
|  |  |  | {{ query.levelStr || '级别' }} | 
|---|
|  |  |  | <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <u-picker :show="order_show" @confirm="select_order" keyName="label" :columns="order_columns" | 
|---|
|  |  |  | @cancel="order_show=false"></u-picker> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <uni-popup ref="popup_level" type="bottom"> | 
|---|
|  |  |  | <view class="component-popup_input_all"> | 
|---|
|  |  |  | <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同级别</view> | 
|---|
|  |  |  | <view v-for="(item,i) in level_columns" :key="i" class="m-t-20"> | 
|---|
|  |  |  | <view class="m-t-12 flex value-items"> | 
|---|
|  |  |  | <view class="value-item" @click="()=>{ | 
|---|
|  |  |  | if(each.value!==query.value){ | 
|---|
|  |  |  | query.level = each.value | 
|---|
|  |  |  | query.levelStr = each.label | 
|---|
|  |  |  | refreshList('post') | 
|---|
|  |  |  | $refs.popup_level.close() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }" :class="[query.level==each.value?'cur':'']" v-for="(each, j) in item" :key="j"> | 
|---|
|  |  |  | {{ each.label || '-' }} | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="button-space"></view> | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <view class="button-green" @click="$refs.popup_level.close()">关闭 | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </uni-popup> | 
|---|
|  |  |  | <uni-popup ref="popup_column" type="bottom"> | 
|---|
|  |  |  | <view class="component-popup_input_all"> | 
|---|
|  |  |  | <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">点击选择不同排序</view> | 
|---|
|  |  |  | <view v-for="(item,i) in order_columns" :key="i" class="m-t-20"> | 
|---|
|  |  |  | <view class="m-t-12 flex value-items"> | 
|---|
|  |  |  | <view class="value-item" @click="()=>{ | 
|---|
|  |  |  | if(each.value!==query.value){ | 
|---|
|  |  |  | query.column = each.value | 
|---|
|  |  |  | query.columnStr = each.label | 
|---|
|  |  |  | refreshList('post') | 
|---|
|  |  |  | $refs.popup_column.close() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }" :class="[query.column==each.value?'cur':'']" v-for="(each, j) in item" :key="j"> | 
|---|
|  |  |  | {{ each.label || '-' }} | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="button-space"></view> | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <view class="button-green" @click="$refs.popup_column.close()">关闭 | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </uni-popup> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <uni-popup ref="popup_param" type="bottom"> | 
|---|
|  |  |  | <view class="component-popup_input_all" v-if="params"> | 
|---|
|  |  |  | <view class="text-center m-b-40" style="font-size: 48rpx;font-weight: 600;">商品参数设置</view> | 
|---|
|  |  |  | 
|---|
|  |  |  | [] | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/list?category=${this.query.category}&zoneId=${this.query.zoneId}&name=${this.query.name}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫-商品列表", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/list?category=${this.query.category}&zoneId=${this.query.zoneId}&name=${this.query.name}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫-商品列表", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/list?category=${this.query.category}&zoneId=${this.query.zoneId}&name=${this.query.name}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫-商品列表", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/sub_pages/customer/trade/list?category=${this.query.category}&zoneId=${this.query.zoneId}&name=${this.query.name}&shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫-商品列表", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | async onLoad(options) { | 
|---|
|  |  |  | // this.list = [{},{}] | 
|---|
|  |  |  | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | async addnum(item, addnum) { | 
|---|
|  |  |  | if (!this.currentInfo.id) { | 
|---|
|  |  |  | await this.$message.confirm('请前往登录') | 
|---|
|  |  |  | // await this.$message.confirm('请前往登录') | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/pages/user/supplier-user' | 
|---|
|  |  |  | url: '/pages/login/supplier-login?source=jump' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="container-trade" :style="{'min-height':hidefooter?'':'calc(100vh - 20rpx)'}"> | 
|---|
|  |  |  | <view class="search-container m-t-12 flex" v-if="!hidefooter"> | 
|---|
|  |  |  | <view class="flex1 input"> | 
|---|
|  |  |  | <u-input placeholder="请输入分类名称" v-model="query.name" clearable> | 
|---|
|  |  |  | <u-input placeholder="请输入分类名称" v-model="query.name" clearable @confirm="buttonSearchFlow" @clear="()=>{ | 
|---|
|  |  |  | $nextTick(()=>{buttonSearchFlow()}) | 
|---|
|  |  |  | }"> | 
|---|
|  |  |  | <template slot="suffix"> | 
|---|
|  |  |  | <uni-icons color="#20613D" type="search" size="24" @tap="buttonSearchFlow"></uni-icons> | 
|---|
|  |  |  | <uni-icons color="#20613D" type="search" size="24" @click="buttonSearchFlow"></uni-icons> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </u-input> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | @click.stop="toDetailList(item)"> | 
|---|
|  |  |  | <view class="m-r-10"> | 
|---|
|  |  |  | <!-- @click.stop="previewImg(item.imageUrl)" --> | 
|---|
|  |  |  | <image :src="item.imageUrl"   :class="[!item.stock?'':'']" | 
|---|
|  |  |  | mode="scaleToFill" class="cover" :lazy-load="true"> | 
|---|
|  |  |  | <image :src="item.imageUrl" :class="[!item.stock?'':'']" mode="scaleToFill" | 
|---|
|  |  |  | class="cover" :lazy-load="true"> | 
|---|
|  |  |  | </image> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="cateen_infos list"> | 
|---|
|  |  |  | 
|---|
|  |  |  | currentCategory: {} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO&¤tInfo.customerDTO.name || that.currentInfo.supplierDTO&¤tInfo.supplierDTO.name || that.currentInfo.partnerDTO&¤tInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #ifdef PUB_CUSTOMER | 
|---|
|  |  |  | onShareAppMessage() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onShareTimeline() { | 
|---|
|  |  |  | let that = this; | 
|---|
|  |  |  | var name = that.currentInfo.customerDTO && currentInfo.customerDTO.name || that.currentInfo.supplierDTO && | 
|---|
|  |  |  | currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && currentInfo.partnerDTO.name || '' | 
|---|
|  |  |  | var url = | 
|---|
|  |  |  | `/pages/home/home?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | title: "花满芫", | 
|---|
|  |  |  | path: url, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // #endif | 
|---|
|  |  |  | onPullDownRefresh() { | 
|---|
|  |  |  | this.$http.request('get', '/api/customer/flower/category/tree', {}).then(res => { | 
|---|