| | |
| | | "quickapp" : {}, |
| | | /* 快应用特有相关 */ |
| | | "mp-weixin" : { |
| | | "appid" : "wx1441324401626290", |
| | | "appid" : "wx3203fd935a6ffe09", |
| | | "setting" : { |
| | | "urlCheck" : false, |
| | | "es6" : true, |
| | |
| | | "style": {
|
| | | "navigationBarTitleText": "订单列表"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "pages/order/order-sale/order-sale",
|
| | | "style": {
|
| | | "navigationBarTitleText": "售后理赔",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "pages/order/order-sale/order-sale-detail",
|
| | | "style": {
|
| | | "navigationBarTitleText": "理赔单详情"
|
| | | }
|
| | | }
|
| | | ],
|
| | | "subPackages": [{
|
| | |
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "order-sale/order-sale",
|
| | | "style": {
|
| | | "navigationBarTitleText": "售后理赔",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | }, |
| | |
|
| | | { |
| | | "path" : "order-settlement/order-settlement-detail", |
| | | "style" : |
| | | { |
| | | "style": {
|
| | | "navigationBarTitleText" : "结算单详情" |
| | | } |
| | | }, |
| | | { |
| | | "path": "order-sale/order-sale-detail",
|
| | | "style" : |
| | | { |
| | | "navigationBarTitleText" : "理赔单详情" |
| | | } |
| | | }
|
| | | // #endif
|
| | |
| | | }
|
| | | },
|
| | | {
|
| | | "path": "partner-info/partner-code", |
| | | "style": { |
| | | "navigationBarTitleText": "二维码", |
| | | "enablePullDownRefresh": false |
| | | } |
| | | }, |
| | | |
| | | {
|
| | | "path": "order-manage/order-manage",
|
| | | "style": {
|
| | | "navigationBarTitleText": "订单管理",
|
| | |
| | | |
| | | </view> |
| | | <view class="t-a form-input" v-if="loginType=='code'"> |
| | | <!-- <input type="text" :password="true" name="password" placeholder="请输入密码" v-model="password" /> --> |
| | | |
| | | <u-input :password="true" :border="false" placeholder="请输入密码" v-model="password"></u-input> |
| | | </view> |
| | |
| | | <!-- #endif --> |
| | | <!-- #ifdef PUB_CUSTOMER --> |
| | | <!-- open-type="getUserInfo"--> |
| | | <button @tap="wxreg('')" class="bottom-button">注 册</button> |
| | | <button @tap="wxreg('')" |
| | | class="bottom-button">注册,{{!partnerId?'未绑定合伙人':`已绑定${partnerName}`}}</button> |
| | | |
| | | <!-- #endif --> |
| | | |
| | | <view class="flex"> |
| | | <view class="topic-font m-l-0 m-r-a" @click="backInfoPage" v-if="source==='step'">返回上一步 |
| | | </view> |
| | | <!-- #ifdef PUB_CUSTOMER --> |
| | | <view class="topic-font m-l-a m-r-a" @click="scanPartnerCode" v-if="source==='step'">扫码绑定合伙人 |
| | | </view> |
| | | <!-- #endif --> |
| | | <view class="topic-font m-l-a m-r-0" @click="toLogin">前往登录</view> |
| | | |
| | | </view> |
| | |
| | | |
| | | phoneNumber: '', |
| | | smsCode: '', |
| | | |
| | | partnerId: '', |
| | | partnerName: '', |
| | | checked: false, |
| | | loginType: 'code', //pwd和code,密码和验证码登录 |
| | | pcfvalue: undefined, |
| | |
| | | this.source = options.source || '' |
| | | }, |
| | | methods: { |
| | | async scanPartnerCode() { |
| | | await this.$message.confirm('确定要绑定合伙人吗?') |
| | | //扫二维码确认 |
| | | let that = this |
| | | uni.scanCode({ |
| | | success: async function(res) { |
| | | console.log('条码内容:' + res.result); |
| | | var dto = undefined |
| | | try { |
| | | dto = JSON.parse(res.result) |
| | | if (!!dto['userId']) { |
| | | that.partnerName = dto['name'] || '' |
| | | that.partnerId = dto['userId'] || '' |
| | | that.$message.showToast(`绑定合伙人${that.partnerName}成功`) |
| | | } else { |
| | | that.$message.showToast('二维码格式不正确扫码失败') |
| | | } |
| | | } catch (e) { |
| | | that.$message.showToast('二维码格式不正确扫码失败') |
| | | } |
| | | }, |
| | | fail() { |
| | | that.$message.showToast('扫码失败') |
| | | |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | backInfoPage() { |
| | | console.log('backInfoPage') |
| | | uni.navigateBack() |
| | |
| | | return |
| | | } |
| | | var dto = JSON.parse(tjson) |
| | | dto.partnerId = this.partnerId || undefined |
| | | post.dto = dto |
| | | } |
| | | post.wxcode = wxcode |
| | |
| | | return { |
| | | id: '', |
| | | dto: {}, |
| | | showSales: false, |
| | | submitForm: {}, |
| | | type: '', |
| | | // #ifdef PUB_CUSTOMER |
| | | type: 'customer', |
| | |
| | | } |
| | | break |
| | | case 'payAgain': { |
| | | await this.$message.confirm('是否确定重新') |
| | | await this.$message.confirm('是否确定重新支付') |
| | | // 发送请求 |
| | | this.$message.showLoading() |
| | | const { |
| | |
| | | } |
| | | } |
| | | break |
| | | case 'couldRefund': { |
| | | case 'sales': { |
| | | //新增售后单 |
| | | //去新的页面加上这些选择? |
| | | this.submitForm = { |
| | | orderId: this.id, |
| | | imageList: [], |
| | | videoList: [], |
| | | reason: [], |
| | | orderItems: [], |
| | | } |
| | | this.showSales = true |
| | | |
| | | } |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | changeSalesOrderItem(dto) { |
| | | if (this.submitForm.orderItems.indexOf(dto.id) < 0) { |
| | | this.submitForm.orderItems.push(dto.id) |
| | | } else { |
| | | this.submitForm.orderItems.splice(this.submitForm.orderItems.indexOf(dto.id), 1) |
| | | } |
| | | }, |
| | | deleteCheckImage(key, index) { |
| | | this.submitForm[key].splice(index, 1) |
| | | this.$forceUpdate() |
| | | }, |
| | | uploadIcon(key) { |
| | | console.log('that dto key', key) |
| | | const that = this |
| | | if (key === 'video') { |
| | | uni.chooseVideo({ |
| | | maxDuration: 30, |
| | | sourceType: ['camera', 'album'], |
| | | success: function(res) { |
| | | if (res.size > 1024 * 1024 * 50) { |
| | | that.$message.confirm('视频最多支持50M大小,超出大小限制') |
| | | return |
| | | } |
| | | if (res.tempFilePath) { |
| | | console.log('res.tempFilePath', res.tempFilePath) |
| | | that.$message.showLoading() |
| | | that.$http.upload(res.tempFilePath).then(async res => { |
| | | var pic = res.data && res.data.length > 0 && res.data[ |
| | | 0] |
| | | .url || '' |
| | | that.$message.hideLoading() |
| | | that.submitForm.videoList.push(pic || '') |
| | | |
| | | that.$forceUpdate() |
| | | }).catch(res => { |
| | | that.$message.hideLoading() |
| | | console.error(res) |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | |
| | | uni.chooseImage({ |
| | | count: 1, // 最多可以选择的图片张数,默认9 |
| | | sizeType: ['compressed'], //original 原图,compressed 压缩图,默认二者都有 |
| | | sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项 |
| | | success: function(res) { |
| | | let errMsg = res.errMsg |
| | | let tempFiles = res.tempFiles |
| | | if (errMsg === 'chooseImage:ok') { |
| | | // console.log(tempFiles[0]) |
| | | if (tempFiles[0].size > 1024 * 1024 * 5) { |
| | | that.$message.confirm('图片最多支持5M大小,超出大小限制') |
| | | return |
| | | } |
| | | that.$message.showLoading() |
| | | that.$http.upload(tempFiles[0].path).then(async res => { |
| | | console.log('res1', res) |
| | | var pic = res.data && res.data.length > 0 && res.data[ |
| | | 0] |
| | | .url || '' |
| | | that.$message.hideLoading() |
| | | that.submitForm.imageList.push(pic) |
| | | |
| | | that.$forceUpdate() |
| | | }).catch(res => { |
| | | that.$message.hideLoading() |
| | | console.error(res) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | async submitSales() { |
| | | if (this.submitForm.orderItems.length < 1) { |
| | | this.$message.showToast('未选择需要售后的商品') |
| | | return |
| | | } |
| | | await this.$message.confirm('确定申请售后吗') |
| | | this.$message.showLoading() |
| | | const { |
| | | code, |
| | | data |
| | | } = await this.$http.request('post', '/api/customer/sales/add', { |
| | | data: { |
| | | ...this.submitForm |
| | | } |
| | | }) |
| | | this.$message.hideLoading() |
| | | if (code == 0) { |
| | | this.$message.showToast('提交成功') |
| | | this.showSales = false |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <view class="order-detail-page"> |
| | | <view class="top-tip flex "> |
| | | <view class="top-tip flex " v-if="!showSales"> |
| | | <image src="/static/common/icon-order-status-SEND.png" class="icon-car m-r-6 img100"></image> |
| | | <view> |
| | | <view>{{ |
| | |
| | | <view class="desc-gray">支付时间:{{dto.paymentTime}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="address-container bg-white br-4 m-t-12"> |
| | | <view class="address-container bg-white br-4 m-t-12" v-if="!showSales"> |
| | | <view class="flex"> |
| | | <image src="/static/common/icon-loc.png" class="image m-r-10"></image> |
| | | |
| | |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="flex m-t-12"> |
| | | <radio :checked="submitForm.orderItems.indexOf(item.id)>=0" @click="changeSalesOrderItem(item)"></radio> |
| | | |
| | | <image class="flower-img img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | |
| | | <view class="title"><span class="level">{{ item.flowerCategory }}</span><span |
| | | class="level">{{ item.flowerLevelStr }}</span>{{ item.flowerName }} |
| | | </view> |
| | | <!-- <view class="m-l-a m-r-0">--> |
| | | <!-- {{item.flowerCategory || '-'}}--> |
| | | <!-- </view>--> |
| | | </view> |
| | | <view class="each-list"> |
| | | <view class="each-item"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="info-container bg-white br-4"> |
| | | <view class="info-container bg-white br-4" v-if="!showSales"> |
| | | <view class="form-item"> |
| | | <view class="label">订单编号:</view> |
| | | <view class="value">{{ dto.orderNo || '-' }}</view> |
| | |
| | | <view class="value">{{ dto.remarks || '-' }}</view> |
| | | </view> |
| | | </view> |
| | | <view class="info-container bg-white br-4 m-t-12"> |
| | | <view class="info-container bg-white br-4 m-t-12" v-if="!showSales"> |
| | | <view class="form-item"> |
| | | <view class="label">订单金额:</view> |
| | | <view class="value">{{ dto.totalAmount || '-' }}</view> |
| | |
| | | |
| | | </view> |
| | | |
| | | <view class="info-container bg-white br-4 m-t-12"> |
| | | <view class="info-container bg-white br-4 m-t-12" v-if="!showSales"> |
| | | <view class="icon-view"> |
| | | <image src="/static/common/icon-kf.png" class="icon-kf m-r-10 img100 icon"></image> |
| | | 我的客服 |
| | |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="info-container form bg-white br-4 m-t-12" v-if="showSales"> |
| | | <!-- 表单更新 --> |
| | | <view class="form-item"> |
| | | <view class="form-item-label"> |
| | | 理由 |
| | | </view> |
| | | <view class="form-item-value"> |
| | | <input v-model="submitForm.reason" clearable placeholder="请输入理由" class="form-input"></input> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-label"> |
| | | 图片 |
| | | </view> |
| | | <view class="form-item-value m-l-a m-r-0"> |
| | | <view class="t-red" @click="uploadIcon('image')">上传</view> |
| | | </view> |
| | | </view> |
| | | <view class="flex p20" v-if="submitForm.imageList&&submitForm.imageList.length>0"> |
| | | <view class="m-t-12 m-r-10 " v-for="(timg,index) of submitForm.imageList" :key="index"> |
| | | <image class="check-img" :src="timg" @click.stop="previewImg(timg)"> |
| | | </image> |
| | | <view class="t-red text-center" @click.stop="deleteCheckImage('imageList',index)">删除</view> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-label"> |
| | | 视频 |
| | | </view> |
| | | <view class="form-item-value m-l-a m-r-0"> |
| | | <view class="t-red" @click="uploadIcon('video')">上传</view> |
| | | </view> |
| | | </view> |
| | | <view class="flex p20" v-if="submitForm.videoList&&submitForm.videoList.length>0"> |
| | | <view class="m-t-12 m-r-10 " v-for="(timg,index) of submitForm.videoList" :key="index"> |
| | | <video :src="timg" style="display: block;margin: 0 auto;"></video> |
| | | |
| | | <view class="t-red text-center" @click.stop="deleteCheckImage('videoList',index)">删除</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- #ifdef PUB_CUSTOMER --> |
| | | |
| | | |
| | | <view class="button-space"></view> |
| | | <view class="buttons-bottom flex"> |
| | | <view class="buttons-bottom flex" v-if="!showSales"> |
| | | <view class="button button-1" @click="buttonClick('refund')" v-if="dto.couldRefund">申请退款 |
| | | </view> |
| | | <view class="button button-1" @click="buttonClick('confirm')" v-if="dto.status ==='RECEIVE'"> 确认收货 |
| | |
| | | </view> |
| | | <view class="button button-1" @click="buttonClick('evaluate')" v-if=" dto.status === 'EVALUATE'"> 评价 |
| | | </view> |
| | | <!-- <view class="button button-1" @click="buttonClick('couldRefund')" |
| | | v-if="dto.couldRefund"> 退款 |
| | | </view> --> |
| | | |
| | | <view class="button button-1" @click="buttonClick('sales')" |
| | | v-if=" dto.status === 'EVALUATE'||dto.status=='COMPLETED'"> 申请售后 |
| | | </view> |
| | | </view> |
| | | <view v-if="showSales"> |
| | | <view style="min-height:200rpx"> |
| | | </view> |
| | | <view class="bottom-price flex"> |
| | | <view class="button-green-1 m-l-a m-r-0" style="min-width: 240rpx" @click="submitSales"> |
| | | 提交售后申请({{submitForm.orderItems&&submitForm.orderItems.length||0}}) |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- #endif --> |
| | | <!-- |
| | |
| | | background: #F7F7F7; |
| | | padding: 30rpx; |
| | | |
| | | .check-img { |
| | | width: 96rpx; |
| | | height: 96rpx; |
| | | border-radius: 4rpx; |
| | | border: 2rpx dashed #CECECE; |
| | | } |
| | | |
| | | .bottom-price { |
| | | position: fixed; |
| | | background-color: #ffffff; |
| | | left: 0rpx; |
| | | padding: 20rpx; |
| | | padding-bottom: 40rpx; |
| | | right: 0rpx; |
| | | bottom: 0rpx; |
| | | |
| | | .button-green-1 { |
| | | min-width: 400rpx; |
| | | padding-left: 20rpx; |
| | | padding-right: 20rpx; |
| | | } |
| | | } |
| | | |
| | | .button-space { |
| | | min-height: 140rpx; |
| | | } |
文件名从 sub_pages/supplier/order-sale/order-sale-detail.vue 修改 |
| | |
| | | // #ifdef PUB_PARTNER |
| | | type: 'partner', |
| | | // #endif |
| | | // #ifdef PUB_CUSTOMER |
| | | type: 'customer', |
| | | // #endif |
| | | }; |
| | | }, |
| | | async onLoad(options) { |
| | |
| | | this.id = options.id || '' |
| | | if (this.id) { |
| | | await this.getDetail() |
| | | this.getItemList() |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | <view class="info"> |
| | | <view class="title"> |
| | | {{ dto.customer }} |
| | | <view class="tel">{{ dto.customerTel }}</view> |
| | | </view> |
| | | <view class="content">{{ dto.customerAddress }}</view> |
| | | <view class="content">{{ dto.customerTel }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | <image class="icon-dp" src="/static/common/icon-dp.png"></image> |
| | | {{ item.supplierName }} |
| | | </view> |
| | | <view class="flex m-t-12"> |
| | | <view class="flex m-t-12 flex-wrap-normal"> |
| | | <image class="flower-img img100 m-r-6" :src="item.flowerCover" @click="previewImg(item.flowerCover)"> |
| | | </image> |
| | | <view class="flex1"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="info-container bg-white br-4"> |
| | | <view class="info-container bg-white m-t-12 br-4"> |
| | | |
| | | <view class="form-item"> |
| | | <view class="label">售后单号:</view> |
| | |
| | | |
| | | .address-container { |
| | | padding: 28rpx; |
| | | |
| | | .image { |
| | | // background-color: #20613D; |
| | | border-radius: 50%; |
| | |
| | | height: 32rpx; |
| | | // padding: 8rpx; |
| | | } |
| | | |
| | | // .icon-loc { |
| | | // width: 48rpx; |
| | | // height: 48rpx; |
| | |
| | | margin-top: 6rpx; |
| | | |
| | | .each-item { |
| | | min-width: 30%; |
| | | max-width: 40%; |
| | | min-width: 40%; |
| | | max-width: 50%; |
| | | text-align: center; |
| | | margin-left: 0rpx; |
| | | margin-right: auto; |
文件名从 sub_pages/supplier/order-sale/order-sale.vue 修改 |
| | |
| | | <view class="order-sale-item br-4 list-item bg-white"> |
| | | <view class="title flex"> |
| | | <view>售后单号:{{item.salesNo}}</view> |
| | | <view class="m-l-a m-r-0 status">审核状态:{{item.auditStatusStr}}</view> |
| | | <view class="m-l-a m-r-0 status">审核状态:{{item.auditStatusStr||'-'}}</view> |
| | | </view> |
| | | <view class="line"></view> |
| | | <view class="form"> |
| | | <view class="sale-form"> |
| | | <view class="form-item"> |
| | | <view class="label" @click="copyTxt(item.orderNo)">订单单号</view> |
| | | <view class="value">{{item.orderNo}}</view> |
| | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | // #ifdef PUB_SUPPLIER |
| | | this.listApi = '/api/supplier/sales/list' |
| | | // #endif |
| | | // #ifdef PUB_PARTNER |
| | | this.listApi = '/api/partner/sales/list' |
| | | // #endif |
| | | // #ifdef PUB_CUSTOMER |
| | | this.listApi = '/api/customer/sales/list' |
| | | // #endif |
| | | this.getList() |
| | | |
| | | }, |
| | |
| | | }, |
| | | toDetail(item) { |
| | | uni.navigateTo({ |
| | | url: `/sub_pages/supplier/order-sale/order-sale-detail?id=${item.id}` |
| | | url: `/pages/order/order-sale/order-sale-detail?id=${item.id}` |
| | | }) |
| | | } |
| | | } |
| | |
| | | margin-bottom: 16rpx; |
| | | } |
| | | |
| | | .form { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | .sale-form { |
| | | // display: flex; |
| | | // flex-wrap: wrap; |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | flex: 1; |
| | | // min-width: 40%; |
| | | // max-width: 50%; |
| | | line-height: 40rpx; |
| | | font-size: 28rpx; |
| | | |
| | | .label { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | line-height: 34rpx; |
| | | } |
| | | |
| | | .label::after { |
| | | content: ":"; |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | line-height: 34rpx; |
| | | } |
| | | |
| | | .value { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #000000; |
| | | line-height: 34rpx; |
| | | } |
| | | |
| | | .value.red { |
| | |
| | | {name: '待发货', value: 'SEND'}, |
| | | {name: '待收货', value: 'RECEIVE'}, |
| | | {name: '待评价', value: 'EVALUATE'}, |
| | | {name: '售后', value: 'COMPLETED'}, |
| | | {name: '已完成', value: 'COMPLETED'}, |
| | | {name: '已退款', value: 'REFUND'}, |
| | | ] |
| | | }; |
| | |
| | | <view class="name" v-if="currentInfo.id">
|
| | | <view class="t1">
|
| | | {{
|
| | | (!!currentInfo.supplierDTO ? (currentInfo.supplierDTO.name) : "") || (!!currentInfo.customerDTO ? (currentInfo.customerDTO.name) : "") || currentInfo.nickName || currentInfo.loginName || '-'
|
| | | (!!currentInfo.partnerDTO ? (currentInfo.partnerDTO.name) : "") || (!!currentInfo.supplierDTO ? (currentInfo.supplierDTO.name) : "") || (!!currentInfo.customerDTO ? (currentInfo.customerDTO.name) : "") || currentInfo.nickName || currentInfo.loginName || '-'
|
| | | }}
|
| | | <span v-if="currentInfo.supplierDTO&¤tInfo.supplierDTO.status!=='P'">
|
| | | ({{ currentInfo.supplierDTO ? currentInfo.supplierDTO.statusStr : '' }})</span>
|
| | |
| | | <image src="../../static/images/customer/order/order-type-4.png" class="order-icon dpj"></image>
|
| | | <view>待评价</view>
|
| | | </view>
|
| | | <view class="order-icons" @click="goto('/pages/order/order?status=COMPLETED',true)">
|
| | | <view class="order-icons" @click="goto('/pages/order/order-sale/order-sale',true)">
|
| | | <image src="../../static/images/customer/order/order-type-5.png" class="order-icon sh"></image>
|
| | | <view>售后</view>
|
| | | </view>
|
| | |
| | | <uni-icons type="right"></uni-icons>
|
| | | </view>
|
| | | </view>
|
| | | <!-- #ifdef PUB_PARTNER -->
|
| | | <view class="user-util m-t-12 flex" v-if="selftype==='partner'"
|
| | | @click="goto('/sub_pages/partner/partner-info/partner-code',true)">
|
| | | <view class="title">推广的注册二维码</view>
|
| | | <view class="right-icon">
|
| | | <uni-icons type="right"></uni-icons>
|
| | | </view>
|
| | | </view>
|
| | | <!-- #endif -->
|
| | | <view class="user-util m-t-12 flex" v-if="selftype==='supplier'"
|
| | | @click="goto('/sub_pages/supplier/supplier-info/supplier-info',true)">
|
| | | <view class="title">店铺信息</view>
|
| | |
| | | } |
| | | |
| | | this.init_area() |
| | | |
| | | // www.hmyxianhua.com/wx-jump |
| | | |
| | | }, |
| | | |
对比新文件 |
| | |
| | | <template> |
| | | <!-- 联系我们 --> |
| | | <!-- --> |
| | | <view class="contact-container"> |
| | | <view class="container" @click="saveCode"> |
| | | <!-- <image src="../../../static/uni.png" mode="aspectFit" class="code"></image> --> |
| | | <canvas type="2d" id="myQrcode" class="code"></canvas> |
| | | <view class="info"> |
| | | <view class="desc"> |
| | | <p>{{name||'-'}}的推广二维码</p> |
| | | <p style="font-size: 600;color: #000;">点击保存二维码</p> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import drawQrcode from '@/plugins/weapp.qrcode.esm.js' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | name: '', |
| | | userId: '', |
| | | canvas: undefined, |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | if (!this.currentInfo.partnerDTO) { |
| | | this.$message.showToast('请先完善合伙人信息') |
| | | return |
| | | } |
| | | this.name = this.currentInfo.partnerDTO.name || '佚名' |
| | | // this.userId = this.currentInfo.userId |
| | | this.initcode() |
| | | }, |
| | | methods: { |
| | | initcode() { |
| | | let that = this |
| | | const query = uni.createSelectorQuery() |
| | | |
| | | query.select('#myQrcode') |
| | | .fields({ |
| | | node: true, |
| | | size: true |
| | | }) |
| | | .exec((res) => { |
| | | var canvas = res[0].node |
| | | that.canvas = canvas |
| | | // 调用方法drawQrcode生成二维码 |
| | | drawQrcode({ |
| | | callback:function(e){ |
| | | console.log('drawQrcode callback',e) |
| | | }, |
| | | canvas: canvas, |
| | | canvasId: 'myQrcode', |
| | | width: 480, |
| | | height: 480, |
| | | padding: 30, |
| | | background: '#ffffff', |
| | | foreground: '#000000', |
| | | text: JSON.stringify({ |
| | | 'name': that.name, |
| | | 'userId': that.currentInfo.id, |
| | | 'version': '1.0.0' |
| | | }), |
| | | // text: `https://www.hmyxianhua.com/wx-c-jump/sub_pages/customer/customer-info/customer-info?name=${that.name}&userId=${that.currentInfo.id}` |
| | | // JSON.stringify({ |
| | | // 'name': that.name, |
| | | // 'userId': this.currentIn fo.id |
| | | // }), |
| | | }) |
| | | // .catch(e) { |
| | | // console.log('drawQrcode', e) |
| | | // } |
| | | }) |
| | | }, |
| | | saveCode() { |
| | | |
| | | // 获取临时路径(得到之后,想干嘛就干嘛了) |
| | | uni.canvasToTempFilePath({ |
| | | canvasId: 'myQrcode', |
| | | canvas: this.canvas, |
| | | x: 0, |
| | | y: 0, |
| | | width: 480, |
| | | height: 480, |
| | | destWidth: 260, |
| | | destHeight: 260, |
| | | success(res) { |
| | | console.log('二维码临时路径:', res.tempFilePath) |
| | | uni.saveImageToPhotosAlbum({ |
| | | filePath: res.tempFilePath, |
| | | success: function() { |
| | | console.log('save success'); |
| | | uni.showToast({ |
| | | title: '保存成功' |
| | | }) |
| | | }, |
| | | fail(res) { |
| | | // console.error(res) |
| | | uni.showToast({ |
| | | title: '保存失败。', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | fail(res) { |
| | | uni.showToast({ |
| | | title: '保存失败', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .contact-container { |
| | | position: relative; |
| | | |
| | | .container { |
| | | position: absolute; |
| | | top: 148rpx; |
| | | // width: 694rpx; |
| | | left: 30rpx; |
| | | right: 30rpx; |
| | | min-height: 712rpx; |
| | | // background: #FFFFFF; |
| | | border-radius: 20rpx; |
| | | |
| | | .code { |
| | | margin-left: auto; |
| | | margin-right: auto; |
| | | margin-top: 24rpx; |
| | | width: 482rpx; |
| | | height: 482rpx; |
| | | margin-bottom: 32rpx; |
| | | display: block; |
| | | } |
| | | |
| | | .info { |
| | | text-align: center; |
| | | |
| | | .desc { |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #666666; |
| | | line-height: 40rpx; |
| | | font-style: normal; |
| | | margin-bottom: 126rpx; |
| | | |
| | | p { |
| | | line-height: 48rpx; |
| | | } |
| | | } |
| | | |
| | | .main { |
| | | font-weight: 600; |
| | | font-size: 48rpx; |
| | | color: #000000; |
| | | margin-top: 48rpx; |
| | | margin-bottom: 32rpx; |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .top-image { |
| | | width: 418rpx; |
| | | height: 228rpx; |
| | | position: absolute; |
| | | top: 16rpx; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <view class="form-item bottom-border-no">
|
| | | <view class="label">商品描述</view>
|
| | | <view class="m-l-a m-r-0 flex">
|
| | | <!-- <u-input type="textarea" v-model="dto.description" placeholder="请输入商品描述" type="number"
|
| | | ></u-input> -->
|
| | | <!-- <u--textarea v-model="dto.description" style="margin-top: 16px;"
|
| | | placeholder="请输入商品描述" count></u--textarea> -->
|
| | | <!-- <uni-easyinput v-model="dto.description" placeholder="请输入商品描述" ></uni-easyinput> -->
|
| | |
|
| | | </view>
|
| | | </view>
|