App.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
pages/login/supplier-login.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
pages/login/supplier-reg.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
pages/user/supplier-user.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/trade/detail.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/trade/list.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
sub_pages/customer/trade/trade.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
App.vue
@@ -5,7 +5,7 @@ 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) { @@ -53,8 +53,8 @@ }); // #ifdef MP if (true && storage.getItem('token')) { setTimeout(async () => { const res = await this.$store.dispatch('getCurrentInfo'); setTimeout(async () => { // #ifndef PUB_CUSTOMER if (this.currentInfo && this.currentInfo.id && !this.currentInfo.openId) { if (this.currentInfo.type === 'admin') { pages/login/supplier-login.vue
@@ -58,7 +58,9 @@ <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="()=>{ @@ -85,6 +87,8 @@ <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 = {} @@ -251,7 +255,8 @@ // }) if (!querydto.partnerUserName) { tmp.$message.showLoading() const resname = await tmp.$http.request('get', '/api/customer/partner/name', { const resname = await tmp.$http.request('get', '/api/customer/partner/name', { params: { id: querydto.partnerUserId } @@ -334,6 +339,8 @@ phoneNumber: '', smsCode: '', source: '', //来源 sharePartnerUserId: '', //分享跳转登录的id checked: false, loginType: 'pwd', //pwd和code,密码和验证码登录 @@ -446,6 +453,9 @@ uni.redirectTo({ url: '/pages/login/supplier-reg' }) // todo 如果是有分享id的,可能需要提前进行绑定 // #endif }, changeAll(e) { @@ -517,6 +527,8 @@ // uni.navigateBack(); // }, 1000); //todo 登录后可能需要进行绑定 } else { // uni.showToast({ // title: '登录失败!', pages/login/supplier-reg.vue
@@ -79,8 +79,8 @@ </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> @@ -166,6 +166,10 @@ 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( pages/user/supplier-user.vue
@@ -340,7 +340,8 @@ // #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 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 { @@ -350,7 +351,8 @@ }, 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 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 { @@ -362,7 +364,8 @@ // #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 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 { @@ -372,7 +375,8 @@ }, 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 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 { @@ -427,9 +431,14 @@ 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("&") dto = {} sub_pages/customer/trade/detail.vue
@@ -146,6 +146,7 @@ id: '', dto: {}, shopnum: 0, sharePartnerUserId: '', } }, onShow() { @@ -155,22 +156,41 @@ 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, } }, @@ -178,10 +198,16 @@ 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, } }, @@ -212,9 +238,9 @@ }, 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 } @@ -257,7 +283,10 @@ }, 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?'移除':'添加到'}收藏`) @@ -285,6 +314,13 @@ 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 @@ -317,6 +353,13 @@ }, 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' }) sub_pages/customer/trade/list.vue
@@ -34,11 +34,12 @@ <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> @@ -122,6 +123,55 @@ <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> @@ -188,7 +238,8 @@ // #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 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 { @@ -198,7 +249,8 @@ }, 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 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 { @@ -375,9 +427,9 @@ // }, 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 } sub_pages/customer/trade/trade.vue
@@ -2,9 +2,11 @@ <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> @@ -39,8 +41,8 @@ @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"> @@ -113,7 +115,8 @@ // #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 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 { @@ -123,7 +126,8 @@ }, 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 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 {