## v1.3.1 更新列表
1. 【修复】申请退款后积分等操作可能出现错误的问题 2. 【修复】拼团支付可能出现支付错误的问题 3. 【修复】退款申请后的订单流程优化和积分赠送的问题 4. 【修复】回收站中的商品无法恢复的问题 5. 【修复】一号通短信查询记录不完整的问题 6. 【修复】用户管理批量加分组,标签的问题 7. 【修复】积分日志搜索显示有误的问题 8. 【修复】手动发送优惠券可能会出错的问题 9. 【修复】核销订单创建在某种条件下会出错的问题 10. 【修复】移动端商品详情,购物车等样式兼容问题 11. 【修复】业务流程性的优化pull/1/MERGE
parent
a6f622572a
commit
621819b067
22
api/order.js
22
api/order.js
|
@ -125,7 +125,7 @@ export function getOrderDetail(uni) {
|
||||||
*/
|
*/
|
||||||
export function orderAgain(uni) {
|
export function orderAgain(uni) {
|
||||||
return request.post('order/again', {
|
return request.post('order/again', {
|
||||||
nui: uni
|
orderNo: uni
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ export function ordeRefundReason() {
|
||||||
* @param object data
|
* @param object data
|
||||||
*/
|
*/
|
||||||
export function orderRefundVerify(data) {
|
export function orderRefundVerify(data) {
|
||||||
return request.post('order/refund/verify', data);
|
return request.post('order/refund', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,7 +176,7 @@ export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain
|
||||||
secKill: secKill,
|
secKill: secKill,
|
||||||
combination:combination,
|
combination:combination,
|
||||||
bargain:bargain
|
bargain:bargain
|
||||||
}, {}, 1);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -215,3 +215,19 @@ export function postOrderComputed(key, data) {
|
||||||
export function qrcodeApi(data) {
|
export function qrcodeApi(data) {
|
||||||
return request.post('qrcode/str2base64', data, {}, 1);
|
return request.post('qrcode/str2base64', data, {}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信订单支付
|
||||||
|
* @param object data
|
||||||
|
*/
|
||||||
|
export function wechatOrderPay(data) {
|
||||||
|
return request.post('pay/payment', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信查询支付结果
|
||||||
|
* @param object data
|
||||||
|
*/
|
||||||
|
export function wechatQueryPayResult(data) {
|
||||||
|
return request.get('pay/queryPayResult', data);
|
||||||
|
}
|
|
@ -78,3 +78,10 @@ export function copyWords() {
|
||||||
return request.get("copy_words", {}, { noAuth: true });
|
return request.get("copy_words", {}, { noAuth: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页 获取客服地址
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export function kefuConfig() {
|
||||||
|
return request.get("config", {}, { noAuth: true });
|
||||||
|
}
|
|
@ -390,9 +390,9 @@ export function getlevelInfo()
|
||||||
* 经验值明细;
|
* 经验值明细;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getlevelExpList()
|
export function getlevelExpList(data)
|
||||||
{
|
{
|
||||||
return request.get("user/expList");
|
return request.get("user/expList",data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,154 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class='Popup' v-if='isShowAuth'>
|
|
||||||
<image :src='logoUrl'></image>
|
|
||||||
<view class='title'>授权提醒</view>
|
|
||||||
<view class='tip'>请授权头像等信息,以便为您提供更好的服务</view>
|
|
||||||
<view class='bottom flex'>
|
|
||||||
<view class='item' @click='close'>随便逛逛</view>
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
|
||||||
<button class='item grant' @click="setUserInfo">去授权</button>
|
|
||||||
<!-- #endif -->
|
|
||||||
<!-- #ifdef MP -->
|
|
||||||
<button class='item grant' type="primary" open-type="getPhoneNumber" lang="zh_CN" @getphonenumber="setUserInfo">去授权</button>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class='mask' v-if='isShowAuth' @click='close'></view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const app = getApp();
|
|
||||||
import Cache from '../utils/cache';
|
|
||||||
import { getLogo } from '../api/public';
|
|
||||||
import { LOGO_URL } from '../config/cache';
|
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import Routine from '../libs/routine';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name:'Authorize',
|
|
||||||
props:{
|
|
||||||
isAuto:{
|
|
||||||
type:Boolean,
|
|
||||||
default:true
|
|
||||||
},
|
|
||||||
isGoIndex:{
|
|
||||||
type:Boolean,
|
|
||||||
default:true
|
|
||||||
},
|
|
||||||
isShowAuth:{
|
|
||||||
type:Boolean,
|
|
||||||
default:false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
logoUrl:''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed:mapGetters(['isLogin','userInfo']),
|
|
||||||
watch:{
|
|
||||||
isLogin(n){
|
|
||||||
n === true && this.$emit('onLoadFun',this.userInfo);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getLogoUrl();
|
|
||||||
this.setAuthStatus();
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
setAuthStatus(){
|
|
||||||
Routine.authorize().then(res=>{
|
|
||||||
if(res.islogin === false)
|
|
||||||
this.setUserInfo();
|
|
||||||
else
|
|
||||||
this.$emit('onLoadFun',this.userInfo);
|
|
||||||
}).catch(res=>{
|
|
||||||
if (this.isAuto)
|
|
||||||
this.$emit('authColse',true);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserInfo(code){
|
|
||||||
console.log(456);
|
|
||||||
Routine.getUserInfo().then(res=>{
|
|
||||||
console.log(123);
|
|
||||||
console.log(res);
|
|
||||||
let userInfo = res.userInfo
|
|
||||||
userInfo.code = code;
|
|
||||||
userInfo.spread_spid = app.globalData.spid;//获取推广人ID
|
|
||||||
userInfo.spread_code = app.globalData.code;//获取推广人分享二维码ID
|
|
||||||
userInfo.avatar = userInfo.userInfo.avatarUrl;
|
|
||||||
userInfo.city = userInfo.userInfo.city;
|
|
||||||
userInfo.country = userInfo.userInfo.country;
|
|
||||||
userInfo.nickName = userInfo.userInfo.nickName;
|
|
||||||
userInfo.province = userInfo.userInfo.province;
|
|
||||||
userInfo.sex = userInfo.userInfo.gender;
|
|
||||||
Routine.authUserInfo(code,userInfo).then(res=>{
|
|
||||||
uni.hideLoading();
|
|
||||||
this.$emit('authColse',false);
|
|
||||||
this.$emit('onLoadFun',this.userInfo);
|
|
||||||
}).catch(res=>{
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
|
||||||
title:res.msg,
|
|
||||||
icon:'none',
|
|
||||||
duration:2000
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}).catch(res =>{
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setUserInfo(e){
|
|
||||||
console.log('78878787');
|
|
||||||
console.log(e);
|
|
||||||
uni.showLoading({title:'正在登录中'});
|
|
||||||
if(e.detail.errMsg == "getPhoneNumber:ok"){
|
|
||||||
console.log('授权成功');
|
|
||||||
Routine.getCode().then(code=>{
|
|
||||||
console.log(code);
|
|
||||||
this.getUserInfo(code);
|
|
||||||
}).catch(res=>{
|
|
||||||
uni.hideLoading();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getLogoUrl(){
|
|
||||||
let that = this;
|
|
||||||
if (Cache.has(LOGO_URL)) {
|
|
||||||
this.logoUrl = Cache.get(LOGO_URL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
getLogo().then(res=>{
|
|
||||||
that.logoUrl = res.data.logo_url
|
|
||||||
Cache.set(LOGO_URL,that.logoUrl);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
close(){
|
|
||||||
let pages = getCurrentPages(), currPage = pages[pages.length - 1];
|
|
||||||
if(this.isGoIndex){
|
|
||||||
uni.switchTab({url:'/pages/index/index'});
|
|
||||||
} else {
|
|
||||||
this.$emit('authColse',false);
|
|
||||||
}
|
|
||||||
// if (currPage && currPage.isShowAuth != undefined){
|
|
||||||
// currPage.isShowAuth = true;
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang='scss'>
|
|
||||||
.Popup{width:500rpx;background-color:#fff;position:fixed;top:50%;left:50%;margin-left:-250rpx;transform:translateY(-50%);z-index:320;}
|
|
||||||
.Popup image{width:150rpx;height:150rpx;margin:-67rpx auto 0 auto;display:block;border: 8rpx solid #fff;border-radius: 50%}
|
|
||||||
.Popup .title{font-size:28rpx;color:#000;text-align:center;margin-top: 30rpx}
|
|
||||||
.Popup .tip{font-size:22rpx;color:#555;padding:0 24rpx;margin-top:25rpx;}
|
|
||||||
.Popup .bottom .item{width:50%;height:80rpx;background-color:#eeeeee;text-align:center;line-height:80rpx;font-size:24rpx;color:#666;margin-top:54rpx;}
|
|
||||||
.Popup .bottom .item.on{width: 100%}
|
|
||||||
.flex{display:flex;}
|
|
||||||
.Popup .bottom .item.grant{font-size:28rpx;color:#fff;font-weight:bold;background-color:#e93323;border-radius:0;padding:0;}
|
|
||||||
.mask{position:fixed;top:0;right:0;left:0;bottom:0;background-color:rgba(0,0,0,0.65);z-index:310;}
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -9,14 +9,15 @@
|
||||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='condition line1'>
|
<view class='condition line2'>
|
||||||
<span class='line-title' :class='item.isUse?"gray":""' v-if='item.type===0'>通用劵</span>
|
<span class='line-title' :class='item.isUse?"gray":""' v-if='item.useType===1'>通用</span>
|
||||||
<span class='line-title' :class='item.isUse?"gray":""' v-else-if='item.type===1'>品类券</span>
|
<span class='line-title' :class='item.isUse?"gray":""' v-else-if='item.useType===3'>品类</span>
|
||||||
<span class='line-title' :class='item.isUse?"gray":""' v-else>商品券</span>
|
<span class='line-title' :class='item.isUse?"gray":""' v-else>商品</span>
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class='data acea-row row-between-wrapper'>
|
<view class='data acea-row row-between-wrapper'>
|
||||||
<view>{{ item.receiveStartTime ? item.receiveStartTime + " ~ " : ""}}{{ item.receiveEndTime }}</view>
|
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
|
||||||
|
<view v-else>{{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}}</view>
|
||||||
<view class='bnt gray' v-if="item.isUse">{{item.use_title || '已领取'}}</view>
|
<view class='bnt gray' v-if="item.isUse">{{item.use_title || '已领取'}}</view>
|
||||||
<view class='bnt bg-color' v-else>{{coupon.statusTile || '立即领取'}}</view>
|
<view class='bnt bg-color' v-else>{{coupon.statusTile || '立即领取'}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -1,173 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view class='coupon-list-window' :class='coupon.coupon==true?"on":""'>
|
|
||||||
<view class='title'>优惠券<text class='iconfont icon-guanbi' @click='close'></text></view>
|
|
||||||
<view class='coupon-list' v-if="coupon.list.length">
|
|
||||||
<view class='item acea-row row-center-wrapper' v-for="(item,index) in coupon.list" @click="getCouponUser(index,item)"
|
|
||||||
:key='index'>
|
|
||||||
<view class='money'>
|
|
||||||
<div>
|
|
||||||
¥<span class="num">{{ item.coupon_price }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="pic-num">满{{ item.use_min_price }}元可用</div>
|
|
||||||
</view>
|
|
||||||
<view class='text'>
|
|
||||||
<view class='condition line1'>
|
|
||||||
<span class="line-title" v-if="item.type === 0">通用劵</span>
|
|
||||||
<span class="line-title" v-else-if="item.type === 1">品类券</span>
|
|
||||||
<span class="line-title" v-else>商品券</span>
|
|
||||||
<span>{{ item.title }}</span>
|
|
||||||
</view>
|
|
||||||
<view class='data acea-row row-between-wrapper'>
|
|
||||||
<view>{{ item.start_time ? item.start_time + "-" : ""}}{{ item.end_time }}</view>
|
|
||||||
<view class="iconfont icon-xuanzhong1 font-color-red" v-if="checked.id === item.id"></view>
|
|
||||||
<view v-else class="iconfont icon-weixuanzhong"></view v-else>
|
|
||||||
<!-- <view class='bnt gray' v-if="item.is_use">{{item.use_title || '已领取'}}</view>
|
|
||||||
<view class='bnt bg-color' v-else>{{coupon.statusTile || '立即领取'}}</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 无优惠券 -->
|
|
||||||
<view class='pictrue' v-else>
|
|
||||||
<image src='../../static/images/noCoupon.png'></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
setCouponReceive
|
|
||||||
} from '@/api/api.js';
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
//打开状态 0=领取优惠券,1=使用优惠券
|
|
||||||
openType: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
coupon: {
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
checked:{
|
|
||||||
type: Object,
|
|
||||||
default: function() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
close: function() {
|
|
||||||
this.$emit('ChangCouponsClone');
|
|
||||||
},
|
|
||||||
getCouponUser: function(index, item) {
|
|
||||||
let that = this;
|
|
||||||
let list = that.coupon.list;
|
|
||||||
that.$emit('ChangCoupons', item);
|
|
||||||
// if (list[index].is_use == true && this.openType == 0) return true;
|
|
||||||
// switch (this.openType) {
|
|
||||||
// case 0:
|
|
||||||
// //领取优惠券
|
|
||||||
// setCouponReceive(id).then(res => {
|
|
||||||
// that.$emit('ChangCouponsUseState', index);
|
|
||||||
// that.$util.Tips({
|
|
||||||
// title: "领取成功"
|
|
||||||
// });
|
|
||||||
// that.$emit('ChangCoupons', list[index]);
|
|
||||||
// })
|
|
||||||
// break;
|
|
||||||
// case 1:
|
|
||||||
// that.$emit('ChangCoupons', index);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.coupon-list-window {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
z-index: 555;
|
|
||||||
transform: translate3d(0, 100%, 0);
|
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window.on {
|
|
||||||
transform: translate3d(0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window .title {
|
|
||||||
height: 124rpx;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 124rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window .title .iconfont {
|
|
||||||
position: absolute;
|
|
||||||
right: 30rpx;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
font-size: 35rpx;
|
|
||||||
color: #8a8a8a;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window .coupon-list {
|
|
||||||
margin: 0 0 50rpx 0;
|
|
||||||
height: 550rpx;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window .pictrue {
|
|
||||||
width: 414rpx;
|
|
||||||
height: 336rpx;
|
|
||||||
margin: 0 auto 50rpx auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coupon-list-window .pictrue image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.coupon-list .item .money{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
.pic-num{
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.condition .line-title{
|
|
||||||
width: 90rpx;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background: rgba(255, 247, 247, 1);
|
|
||||||
border: 1px solid rgba(232, 51, 35, 1);
|
|
||||||
opacity: 1;
|
|
||||||
border-radius: 22rpx;
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #e83323;
|
|
||||||
margin-right: 12rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -6,7 +6,8 @@
|
||||||
<view class='money font-color'>¥<text class='num'>{{item.money}}</text></view>
|
<view class='money font-color'>¥<text class='num'>{{item.money}}</text></view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='name'>购物买{{item.minPrice}}减{{item.money}}</view>
|
<view class='name'>购物买{{item.minPrice}}减{{item.money}}</view>
|
||||||
<view>{{item.receiveStartTime ? item.receiveStartTime+'~' : ''}}{{item.receiveEndTime}}</view>
|
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
|
||||||
|
<view v-else>{{item.useStartTimeStr&&item.useEndTimeStr ? item.useStartTimeStr+'~'+item.useEndTimeStr : ''}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
orderPay
|
orderPay,
|
||||||
|
wechatOrderPay
|
||||||
} from '@/api/order.js';
|
} from '@/api/order.js';
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
@ -70,35 +71,22 @@
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '支付中'
|
title: '支付中'
|
||||||
});
|
});
|
||||||
orderPay({
|
wechatOrderPay({
|
||||||
uni: that.order_id,
|
orderNo: that.order_id,
|
||||||
paytype: paytype,
|
payChannel: this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||||
// #ifdef MP
|
payType: paytype
|
||||||
'from': 'routine',
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5 || APP-PLUS
|
|
||||||
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
|
||||||
// #endif
|
|
||||||
// // #ifdef H5
|
|
||||||
// quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location.port + '/pages/users/order_details/index?order_id=' + this.order_id : location.protocol + '//' + location.hostname +
|
|
||||||
// '/pages/users/order_details/index?order_id=' + that.order_id
|
|
||||||
// // #endif
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
switch (paytype) {
|
|
||||||
case 'weixin':
|
|
||||||
if (res.data.result === undefined) return that.$util.Tips({
|
|
||||||
title: '缺少支付参数'
|
|
||||||
});
|
|
||||||
// #ifdef MP || APP-PLUS
|
|
||||||
let jsConfig = res.data.jsConfig;
|
let jsConfig = res.data.jsConfig;
|
||||||
// let packages = 'prepay_id=' + jsConfig.prepayId;
|
switch (res.data.payType) {
|
||||||
|
case 'weixin':
|
||||||
|
// #ifdef MP
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
timeStamp: jsConfig.timeStamp.toString(),
|
timeStamp: jsConfig.timeStamp,
|
||||||
nonceStr: jsConfig.nonceStr,
|
nonceStr: jsConfig.nonceStr,
|
||||||
package: jsConfig.package,
|
package: jsConfig.packages,
|
||||||
signType: jsConfig.signType,
|
signType: jsConfig.signType,
|
||||||
paySign: jsConfig.paySign,
|
paySign: jsConfig.paySign,
|
||||||
success: function(res) {
|
success: function(ress) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '支付成功',
|
title: '支付成功',
|
||||||
|
@ -129,38 +117,25 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (res.data.status === "WECHAT_PAY") {
|
|
||||||
let jsConfig = res.data.jsConfig;
|
|
||||||
//let packages = 'prepay_id=' + jsConfig.prepayId;
|
|
||||||
let datas = {
|
let datas = {
|
||||||
timestamp:jsConfig.timeStamp,
|
timestamp: jsConfig.timeStamp,
|
||||||
nonceStr:jsConfig.nonceStr,
|
nonceStr: jsConfig.nonceStr,
|
||||||
package:jsConfig.package,
|
package: jsConfig.packages,
|
||||||
signType:jsConfig.signType,
|
signType: jsConfig.signType,
|
||||||
paySign:jsConfig.paySign
|
paySign: jsConfig.paySign
|
||||||
};
|
};
|
||||||
that.$wechat.pay(datas)
|
that.$wechat.pay(datas).then(res => {
|
||||||
.then(() => {
|
if (res.errMsg == 'chooseWXPay:cancel') {
|
||||||
return that.$util.Tips({
|
|
||||||
title: "支付成功",
|
|
||||||
icon: 'success'
|
|
||||||
}, () => {
|
|
||||||
that.$emit('onChangeFun', {
|
|
||||||
action: 'pay_complete'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(function() {
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '支付失败'
|
title: '支付失败'
|
||||||
});
|
});
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading();
|
wechatQueryPayResult({
|
||||||
location.replace(res.data.jsConfig.h5PayUrl);
|
orderNo: that.order_id
|
||||||
|
}).then(res => {
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: "支付成功",
|
title: "支付成功",
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
|
@ -169,7 +144,14 @@
|
||||||
action: 'pay_complete'
|
action: 'pay_complete'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}).cache(errW => {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: errW
|
||||||
|
});
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
||||||
// #endif
|
// #endif
|
||||||
break;
|
break;
|
||||||
case 'yue':
|
case 'yue':
|
||||||
|
@ -183,10 +165,11 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'offline':
|
case 'weixinh5':
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
location.replace(jsConfig.mwebUrl);
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '线下支付成功',
|
title: "支付成功",
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, () => {
|
}, () => {
|
||||||
that.$emit('onChangeFun', {
|
that.$emit('onChangeFun', {
|
||||||
|
@ -195,6 +178,119 @@
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// switch (paytype) {
|
||||||
|
// case 'weixin':
|
||||||
|
// if (res.data.result === undefined) return that.$util.Tips({
|
||||||
|
// title: '缺少支付参数'
|
||||||
|
// });
|
||||||
|
// // #ifdef MP || APP-PLUS
|
||||||
|
// let jsConfig = res.data.jsConfig;
|
||||||
|
// uni.requestPayment({
|
||||||
|
// timeStamp: jsConfig.timeStamp.toString(),
|
||||||
|
// nonceStr: jsConfig.nonceStr,
|
||||||
|
// package: jsConfig.package,
|
||||||
|
// signType: jsConfig.signType,
|
||||||
|
// paySign: jsConfig.paySign,
|
||||||
|
// success: function(res) {
|
||||||
|
// uni.hideLoading();
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: '支付成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_complete'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// fail: function(e) {
|
||||||
|
// uni.hideLoading();
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: '取消支付'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_fail'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// complete: function(e) {
|
||||||
|
// uni.hideLoading();
|
||||||
|
// if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||||
|
// title: '取消支付'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_fail'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// // #endif
|
||||||
|
// // #ifdef H5
|
||||||
|
// if (res.data.status === "WECHAT_PAY") {
|
||||||
|
// let jsConfig = res.data.jsConfig;
|
||||||
|
// //let packages = 'prepay_id=' + jsConfig.prepayId;
|
||||||
|
// let datas = {
|
||||||
|
// timestamp:jsConfig.timeStamp,
|
||||||
|
// nonceStr:jsConfig.nonceStr,
|
||||||
|
// package:jsConfig.package,
|
||||||
|
// signType:jsConfig.signType,
|
||||||
|
// paySign:jsConfig.paySign
|
||||||
|
// };
|
||||||
|
// that.$wechat.pay(datas)
|
||||||
|
// .then(() => {
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: "支付成功",
|
||||||
|
// icon: 'success'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_complete'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// })
|
||||||
|
// .catch(function() {
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: '支付失败'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// uni.hideLoading();
|
||||||
|
// location.replace(res.data.jsConfig.h5PayUrl);
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: "支付成功",
|
||||||
|
// icon: 'success'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_complete'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// // #endif
|
||||||
|
// break;
|
||||||
|
// case 'yue':
|
||||||
|
// uni.hideLoading();
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: '余额支付成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_complete'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// break;
|
||||||
|
// case 'offline':
|
||||||
|
// uni.hideLoading();
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: '线下支付成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// }, () => {
|
||||||
|
// that.$emit('onChangeFun', {
|
||||||
|
// action: 'pay_complete'
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
|
|
|
@ -93,7 +93,6 @@
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.attr)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goCat:function(){
|
goCat:function(){
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;align-items: center; height: 100%;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="false">
|
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;align-items: center; height: 100%;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="false">
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view v-for="(item,index) in tabTitle[tabClick].child?tabTitle[tabClick].child:[]" :key="index" class="child-item" :class="{on:index == childIndex}" @click="childTab(tabClick,index)">
|
<view v-for="(item,index) in tabTitle[tabClick].child?tabTitle[tabClick].child:[]" :key="index" class="child-item" :class="{on:index == childIndex}" @click="childTab(tabClick,index)">
|
||||||
<image :src="item.extra" mode=""></image>
|
<image :src="item.extra" mode="" :style="{'background-color':item.extra?'none':'#f7f7f7'}"></image>
|
||||||
<view class="txt line1">{{item.name}}</view>
|
<view class="txt line1">{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -11,10 +11,12 @@
|
||||||
<view class="start" :class="'star' + item.productScore"></view>
|
<view class="start" :class="'star' + item.productScore"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="time">{{ item.createTime }}</view>
|
<view class="time">{{ item.createTime }}</view>
|
||||||
<!-- <view class="time">{{ item.createTime }} {{ item.suk }}</view> -->
|
<!-- <view class="time">{{ item.createTime }}</view>
|
||||||
|
<view class="time">{{ item.suk }}</view> -->
|
||||||
|
<!-- <view class="time">{{ item.createTime }} {{ item.sku }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="time">规格:{{ item.sku?item.sku:'无' }}</view>
|
||||||
<view class="evaluate-infor">{{ item.comment }}</view>
|
<view class="evaluate-infor">{{ item.comment }}</view>
|
||||||
<view class="imgList acea-row" v-if="item.pics.length && item.pics[0]">
|
<view class="imgList acea-row" v-if="item.pics.length && item.pics[0]">
|
||||||
<view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">
|
<view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">
|
||||||
|
|
|
@ -648,7 +648,6 @@ const initPicker={
|
||||||
let bDate=new Date(tYear,curMonth,curDate).getTime();
|
let bDate=new Date(tYear,curMonth,curDate).getTime();
|
||||||
let months=[];
|
let months=[];
|
||||||
if(bDate-aDate>0){
|
if(bDate-aDate>0){
|
||||||
console.log(1)
|
|
||||||
for(let m=1;m<=12;m++){
|
for(let m=1;m<=12;m++){
|
||||||
months.push(forMatNum(m));
|
months.push(forMatNum(m));
|
||||||
};
|
};
|
||||||
|
|
|
@ -312,7 +312,6 @@
|
||||||
},
|
},
|
||||||
defaultVal(val){
|
defaultVal(val){
|
||||||
this.initData();
|
this.initData();
|
||||||
console.log(val)
|
|
||||||
},
|
},
|
||||||
areaCode(){
|
areaCode(){
|
||||||
this.initData();
|
this.initData();
|
||||||
|
|
|
@ -51,16 +51,13 @@ class AuthWechat {
|
||||||
// if (this.status && !this.isAndroid()) return resolve(this.instance);
|
// if (this.status && !this.isAndroid()) return resolve(this.instance);
|
||||||
getWechatConfig()
|
getWechatConfig()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
let data = res.data;
|
this.instance.config(res.data);
|
||||||
// delete data.jsApiTicket;
|
this.initConfig = res.data;
|
||||||
this.instance.config(data);
|
|
||||||
this.initConfig = data;
|
|
||||||
this.status = true;
|
this.status = true;
|
||||||
this.instance.ready(() => {
|
this.instance.ready(() => {
|
||||||
resolve(this.instance);
|
resolve(this.instance);
|
||||||
})
|
})
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
|
||||||
this.status = false;
|
this.status = false;
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
|
@ -124,7 +121,8 @@ class AuthWechat {
|
||||||
this.toPromise(wx.chooseWXPay, config).then(res => {
|
this.toPromise(wx.chooseWXPay, config).then(res => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
reject(res);
|
console.log('js中的错误',res)
|
||||||
|
resolve(res);
|
||||||
});
|
});
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
reject(res);
|
reject(res);
|
||||||
|
@ -174,7 +172,6 @@ class AuthWechat {
|
||||||
auth(code) {
|
auth(code) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let loginType = Cache.get(LOGINTYPE);
|
let loginType = Cache.get(LOGINTYPE);
|
||||||
console.log('spread', Cache.get("spread"))
|
|
||||||
wechatAuth(code, Cache.get("spread"), loginType)
|
wechatAuth(code, Cache.get("spread"), loginType)
|
||||||
.then(({
|
.then(({
|
||||||
data
|
data
|
||||||
|
@ -252,7 +249,6 @@ class AuthWechat {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(res);
|
|
||||||
return resolve(res,2222);
|
return resolve(res,2222);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -359,7 +359,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
console.log(that.bargainUid,'that.bargainUid')
|
|
||||||
if(that.bargainUid == 'undefined'){
|
if(that.bargainUid == 'undefined'){
|
||||||
that.bargainUid = that.$store.state.app.uid
|
that.bargainUid = that.$store.state.app.uid
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,7 +314,9 @@
|
||||||
isState: true, //默认不显示
|
isState: true, //默认不显示
|
||||||
},
|
},
|
||||||
tagStyle: {
|
tagStyle: {
|
||||||
img: 'width:100%;'
|
img: 'width:100%;display:block;',
|
||||||
|
table: 'width:100%',
|
||||||
|
video: 'width:100%'
|
||||||
},
|
},
|
||||||
posters: false,
|
posters: false,
|
||||||
weixinStatus: false,
|
weixinStatus: false,
|
||||||
|
@ -531,53 +533,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//#endif
|
//#endif
|
||||||
// setTime: function() { //到期时间戳
|
|
||||||
// var that = this;
|
|
||||||
// var endTimeList = that.pink;
|
|
||||||
// that.pink.map(item => {
|
|
||||||
// item.time = {
|
|
||||||
// day: '00',
|
|
||||||
// hou: '00',
|
|
||||||
// min: '00',
|
|
||||||
// sec: '00'
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
// var countDownArr = [];
|
|
||||||
// var timeer = setInterval(function() {
|
|
||||||
// var newTime = new Date().getTime() / 1000;
|
|
||||||
// for (var i in endTimeList) {
|
|
||||||
// var endTime = endTimeList[i].stop_time;
|
|
||||||
// var obj = [];
|
|
||||||
// if (endTime - newTime > 0) {
|
|
||||||
// var time = endTime - newTime;
|
|
||||||
// var day = parseInt(time / (60 * 60 * 24));
|
|
||||||
// var hou = parseInt(time % (60 * 60 * 24) / 3600);
|
|
||||||
// var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
|
|
||||||
// var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
|
|
||||||
// hou = parseInt(hou) + parseInt(day * 24);
|
|
||||||
// obj = {
|
|
||||||
// day: that.timeFormat(day),
|
|
||||||
// hou: that.timeFormat(hou),
|
|
||||||
// min: that.timeFormat(min),
|
|
||||||
// sec: that.timeFormat(sec)
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// obj = {
|
|
||||||
// day: '00',
|
|
||||||
// hou: '00',
|
|
||||||
// min: '00',
|
|
||||||
// sec: '00'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// endTimeList[i].time = obj;
|
|
||||||
// }
|
|
||||||
// that.pink = endTimeList
|
|
||||||
// }, 1000);
|
|
||||||
// that.timeer = timeer
|
|
||||||
// },
|
|
||||||
// timeFormat(param) { //小于10的格式化函数
|
|
||||||
// return param < 10 ? '0' + param : param;
|
|
||||||
// },
|
|
||||||
/**
|
/**
|
||||||
* 默认选中属性
|
* 默认选中属性
|
||||||
*
|
*
|
||||||
|
@ -936,7 +891,7 @@
|
||||||
let storeName = that.storeInfo.title;
|
let storeName = that.storeInfo.title;
|
||||||
let price = that.storeInfo.price;
|
let price = that.storeInfo.price;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice, function(tempFilePath) {
|
||||||
that.posterImage = tempFilePath;
|
that.posterImage = tempFilePath;
|
||||||
that.canvasStatus = true;
|
that.canvasStatus = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -425,13 +425,6 @@ export default {
|
||||||
that.isOpen = true;
|
that.isOpen = true;
|
||||||
},
|
},
|
||||||
goPay() {
|
goPay() {
|
||||||
// productId: that.storeInfo.productId,
|
|
||||||
// combinationId:parseFloat(that.id),
|
|
||||||
// cartNum: that.cart_num ? this.cart_num : this.attribute.productSelect.cart_num,
|
|
||||||
// productAttrUnique: productSelect !== undefined ? productSelect.id : '',
|
|
||||||
// isNew: true,
|
|
||||||
|
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
var data = {};
|
var data = {};
|
||||||
// that.attr.cartAttr = res;
|
// that.attr.cartAttr = res;
|
||||||
|
@ -441,7 +434,6 @@ export default {
|
||||||
data.productAttrUnique = that.attr.productSelect.unique;
|
data.productAttrUnique = that.attr.productSelect.unique;
|
||||||
data.combinationId = that.storeCombination.id;
|
data.combinationId = that.storeCombination.id;
|
||||||
data.isNew = true;
|
data.isNew = true;
|
||||||
console.log(that.pinkId);
|
|
||||||
postCartAdd(data)
|
postCartAdd(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
@ -245,7 +245,9 @@
|
||||||
lock: false,
|
lock: false,
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
tagStyle: {
|
tagStyle: {
|
||||||
img: 'width:100%;'
|
img: 'width:100%;display:block;',
|
||||||
|
table: 'width:100%',
|
||||||
|
video: 'width:100%'
|
||||||
},
|
},
|
||||||
datatime: '',
|
datatime: '',
|
||||||
navActive: 0,
|
navActive: 0,
|
||||||
|
@ -581,50 +583,6 @@
|
||||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// ChangeCartNum: function(changeValue) {
|
|
||||||
// //changeValue:是否 加|减
|
|
||||||
// //获取当前变动属性
|
|
||||||
// let productSelect = this.productValue[this.attrValue];
|
|
||||||
// if (this.cart_num) {
|
|
||||||
// productSelect.cart_num = this.cart_num;
|
|
||||||
// this.attribute.productSelect.cart_num = this.cart_num;
|
|
||||||
// }
|
|
||||||
// //如果没有属性,赋值给商品默认库存
|
|
||||||
// if (productSelect === undefined && !this.attribute.productAttr.length)
|
|
||||||
// productSelect = this.attribute.productSelect;
|
|
||||||
// //无属性值即库存为0;不存在加减;
|
|
||||||
// if (productSelect === undefined) return;
|
|
||||||
// let stock = productSelect.stock || 0;
|
|
||||||
// let num = this.attribute.productSelect;
|
|
||||||
// let quota = productSelect.quota || 0;
|
|
||||||
// //设置默认数据
|
|
||||||
// if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
|
|
||||||
// if (changeValue) {
|
|
||||||
// num.cart_num ++;
|
|
||||||
// if(quota >= stock){
|
|
||||||
// if (num.cart_num > stock) {
|
|
||||||
// this.$set(this.attribute.productSelect, "cart_num", stock);
|
|
||||||
// this.$set(this, "cart_num", stock);
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// if (num.cart_num > quota) {
|
|
||||||
// this.$set(this.attribute.productSelect, "cart_num", quota);
|
|
||||||
// this.$set(this, "cart_num", quota);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.$set(this, "cart_num", num.cart_num);
|
|
||||||
// this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// num.cart_num--;
|
|
||||||
// if (num.cart_num < 1) {
|
|
||||||
// this.$set(this.attribute.productSelect, "cart_num", 1);
|
|
||||||
// this.$set(this, "cart_num", 1);
|
|
||||||
// }
|
|
||||||
// this.$set(this, "cart_num", num.cart_num);
|
|
||||||
// this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
attrVal(val) {
|
attrVal(val) {
|
||||||
this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attrValues[val.indexn];
|
this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attrValues[val.indexn];
|
||||||
},
|
},
|
||||||
|
@ -882,20 +840,13 @@
|
||||||
let storeName = that.storeInfo.storeName;
|
let storeName = that.storeInfo.storeName;
|
||||||
let price = that.storeInfo.price;
|
let price = that.storeInfo.price;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||||
that.posterImage = tempFilePath;
|
that.posterImage = tempFilePath;
|
||||||
that.canvasStatus = true;
|
that.canvasStatus = true;
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode];
|
|
||||||
// let storeName = that.storeInfo.storeName;
|
|
||||||
// let price = that.storeInfo.price;
|
|
||||||
// that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
|
||||||
// that.posterImage = tempFilePath;
|
|
||||||
// that.canvasStatus = true;
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
// 小程序二维码
|
// 小程序二维码
|
||||||
getQrcode(){
|
getQrcode(){
|
||||||
|
|
|
@ -158,7 +158,6 @@
|
||||||
uni.getImageInfo({
|
uni.getImageInfo({
|
||||||
src: arrImages[0],
|
src: arrImages[0],
|
||||||
success: function (image) {
|
success: function (image) {
|
||||||
console.log('啦啦', image)
|
|
||||||
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
||||||
context.setFontSize(36);
|
context.setFontSize(36);
|
||||||
context.setTextAlign('center');
|
context.setTextAlign('center');
|
||||||
|
@ -210,19 +209,15 @@
|
||||||
canvasId: 'firstCanvas',
|
canvasId: 'firstCanvas',
|
||||||
fileType: 'jpg',
|
fileType: 'jpg',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log('啦啦222', res)
|
|
||||||
// 在H5平台下,tempFilePath 为 base64
|
// 在H5平台下,tempFilePath 为 base64
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
//successFn && successFn(res.tempFilePath);
|
|
||||||
that.imagePath = res.tempFilePath;
|
that.imagePath = res.tempFilePath;
|
||||||
console.log(that.imagePath)
|
|
||||||
that.canvasStatus = true;
|
that.canvasStatus = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
console.log(err)
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: '无法获取图片信息'
|
title: '无法获取图片信息'
|
||||||
|
|
|
@ -179,7 +179,6 @@
|
||||||
},
|
},
|
||||||
setInfo: function(item) {
|
setInfo: function(item) {
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log(item);
|
|
||||||
setAdminOrderDelivery(item).then(
|
setAdminOrderDelivery(item).then(
|
||||||
res => {
|
res => {
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
|
@ -197,7 +196,6 @@
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
bindPickerChange(e){
|
bindPickerChange(e){
|
||||||
console.log(e,'tar')
|
|
||||||
this.seIndex = e.detail.value
|
this.seIndex = e.detail.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,6 @@
|
||||||
that.getIndex();
|
that.getIndex();
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err, 'err')
|
|
||||||
that.change = false;
|
that.change = false;
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
|
@ -364,13 +363,11 @@
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
webCopy(item, index) {
|
webCopy(item, index) {
|
||||||
console.log('yunxingle')
|
|
||||||
let items = item
|
let items = item
|
||||||
let indexs = index
|
let indexs = index
|
||||||
let self = this
|
let self = this
|
||||||
|
|
||||||
if (self.clickNum == 1) {
|
if (self.clickNum == 1) {
|
||||||
console.log('22')
|
|
||||||
self.clickNum += 1
|
self.clickNum += 1
|
||||||
self.webCopy(items, indexs)
|
self.webCopy(items, indexs)
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,6 @@
|
||||||
that.init();
|
that.init();
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err,'err')
|
|
||||||
that.change = false;
|
that.change = false;
|
||||||
that.$util.Tips({title: err});
|
that.$util.Tips({title: err});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,6 @@
|
||||||
wechat.auth(code, state)
|
wechat.auth(code, state)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
console.log(res);
|
|
||||||
console.log(option.back_url);
|
|
||||||
console.log(decodeURIComponent(
|
|
||||||
decodeURIComponent(option.back_url)
|
|
||||||
));
|
|
||||||
that.$store.commit("SETUID", res.data.uid);
|
that.$store.commit("SETUID", res.data.uid);
|
||||||
location.href = decodeURIComponent(
|
location.href = decodeURIComponent(
|
||||||
decodeURIComponent(option.back_url)
|
decodeURIComponent(option.back_url)
|
||||||
|
|
|
@ -382,7 +382,6 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onReady: function() {
|
onReady: function() {
|
||||||
console.log(this.emojiGroup);
|
|
||||||
this.height();
|
this.height();
|
||||||
this.getHistory();
|
this.getHistory();
|
||||||
this.getproductInfo();
|
this.getproductInfo();
|
||||||
|
@ -417,7 +416,6 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
uploadImg() {
|
uploadImg() {
|
||||||
console.log(this.$store.state.app.token)
|
|
||||||
let self = this
|
let self = this
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1, //默认1
|
count: 1, //默认1
|
||||||
|
@ -460,7 +458,6 @@
|
||||||
getOrderInfo() {
|
getOrderInfo() {
|
||||||
if (!this.orderId) return;
|
if (!this.orderId) return;
|
||||||
getOrderDetail(this.orderId).then(res => {
|
getOrderDetail(this.orderId).then(res => {
|
||||||
console.log(res)
|
|
||||||
this.orderInfo = res.data;
|
this.orderInfo = res.data;
|
||||||
if (this.orderInfo.add_time_h) {
|
if (this.orderInfo.add_time_h) {
|
||||||
this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(
|
this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(
|
||||||
|
@ -511,7 +508,6 @@
|
||||||
this.loaded = data.length < this.limit;
|
this.loaded = data.length < this.limit;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log(err);
|
|
||||||
this.$dialog.error(err || "加载失败");
|
this.$dialog.error(err || "加载失败");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -588,7 +584,6 @@
|
||||||
if (this.timeOutEvent !== 0 && this.longClick === 0) {
|
if (this.timeOutEvent !== 0 && this.longClick === 0) {
|
||||||
//点击
|
//点击
|
||||||
//此处为点击事件----在此处添加跳转详情页
|
//此处为点击事件----在此处添加跳转详情页
|
||||||
console.log("这是点击");
|
|
||||||
}
|
}
|
||||||
this.speak = "按住 说话";
|
this.speak = "按住 说话";
|
||||||
this.recording = false;
|
this.recording = false;
|
||||||
|
@ -643,10 +638,9 @@
|
||||||
setTimeout(res=>{
|
setTimeout(res=>{
|
||||||
let info = uni.createSelectorQuery().select(".chat");
|
let info = uni.createSelectorQuery().select(".chat");
|
||||||
info.boundingClientRect(function(data) { //data - 各种参数
|
info.boundingClientRect(function(data) { //data - 各种参数
|
||||||
console.log(data.height) // 获取元素宽度
|
// 获取元素宽度
|
||||||
scrollTop = data.height
|
scrollTop = data.height
|
||||||
}).exec()
|
}).exec()
|
||||||
console.log(scrollTop,'scrollTop')
|
|
||||||
if(this.active){
|
if(this.active){
|
||||||
this.scrollTop = scrollTop+500
|
this.scrollTop = scrollTop+500
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<view class='list acea-row'>
|
<view class='list acea-row'>
|
||||||
<block v-for="(itemn,indexn) in item.child" :key="indexn">
|
<block v-for="(itemn,indexn) in item.child" :key="indexn">
|
||||||
<navigator hover-class='none' :url='"/pages/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
|
<navigator hover-class='none' :url='"/pages/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
|
||||||
<view class='picture'>
|
<view class='picture' :style="{'background-color':itemn.extra?'none':'#f7f7f7'}">
|
||||||
<image :src='itemn.extra'></image>
|
<image :src='itemn.extra'></image>
|
||||||
</view>
|
</view>
|
||||||
<view class='name line1'>{{itemn.name}}</view>
|
<view class='name line1'>{{itemn.name}}</view>
|
||||||
|
@ -241,6 +241,9 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
div{
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.productSort .conter .list .item .name {
|
.productSort .conter .list .item .name {
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
</view>
|
</view>
|
||||||
<view class='introduce'>{{storeInfo.storeName}}</view>
|
<view class='introduce'>{{storeInfo.storeName}}</view>
|
||||||
<view class='label acea-row row-between-wrapper'>
|
<view class='label acea-row row-between-wrapper'>
|
||||||
<view>原价:¥{{storeInfo.otPrice}}</view>
|
<view>原价:¥{{storeInfo.otPrice || 0}}</view>
|
||||||
<view>库存:{{storeInfo.stock}}{{storeInfo.unitName}}</view>
|
<view>库存:{{storeInfo.stock || 0}}{{storeInfo.unitName || ''}}</view>
|
||||||
<view>销量:{{Number(storeInfo.sales) + Number(storeInfo.ficti) || 0}}{{storeInfo.unitName}}</view>
|
<view>销量:{{Math.floor(storeInfo.sales) + Math.floor(storeInfo.ficti) || 0}}{{storeInfo.unitName || ''}}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class='coupon acea-row row-between-wrapper' v-if="storeInfo.give_integral > 0">
|
<!-- <view class='coupon acea-row row-between-wrapper' v-if="storeInfo.give_integral > 0">
|
||||||
<view class='hide line1 acea-row'>
|
<view class='hide line1 acea-row'>
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
<navigator open-type='switchTab' class="animated item" :class="animated==true?'bounceIn':''" url='/pages/order_addcart/order_addcart'
|
<navigator open-type='switchTab' class="animated item" :class="animated==true?'bounceIn':''" url='/pages/order_addcart/order_addcart'
|
||||||
hover-class="none">
|
hover-class="none">
|
||||||
<view class='iconfont icon-gouwuche1'>
|
<view class='iconfont icon-gouwuche1'>
|
||||||
<text class='num bg-color'>{{CartCount || 0}}</text>
|
<text v-if="Math.floor(CartCount)>0" class='num bg-color'>{{CartCount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>购物车</view>
|
<view>购物车</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
|
@ -340,7 +340,9 @@
|
||||||
lock: false,
|
lock: false,
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
tagStyle: {
|
tagStyle: {
|
||||||
img: 'width:100%;'
|
img: 'width:100%;display:block;',
|
||||||
|
table: 'width:100%',
|
||||||
|
video: 'width:100%'
|
||||||
},
|
},
|
||||||
sliderImage: [],
|
sliderImage: [],
|
||||||
qrcodeSize: 600,
|
qrcodeSize: 600,
|
||||||
|
@ -419,7 +421,6 @@
|
||||||
// #endif
|
// #endif
|
||||||
methods: {
|
methods: {
|
||||||
getChat(uid){
|
getChat(uid){
|
||||||
console.log(this.uid)
|
|
||||||
window.yzf && window.yzf.init({
|
window.yzf && window.yzf.init({
|
||||||
sign: '37ef9b97872756ce2a1596ec4fe9b66b0b4cbeec7b36239a65924fa6cbd5c29ac6b013c274511b2eee929e72312baeeeb97aae86',
|
sign: '37ef9b97872756ce2a1596ec4fe9b66b0b4cbeec7b36239a65924fa6cbd5c29ac6b013c274511b2eee929e72312baeeeb97aae86',
|
||||||
token: '', //非必填
|
token: '', //非必填
|
||||||
|
@ -786,7 +787,6 @@
|
||||||
DefaultSelect: function() {
|
DefaultSelect: function() {
|
||||||
let productAttr = this.attr.productAttr;
|
let productAttr = this.attr.productAttr;
|
||||||
let value = [];
|
let value = [];
|
||||||
console.log(this.productValue)
|
|
||||||
for (let key in this.productValue) {
|
for (let key in this.productValue) {
|
||||||
if (this.productValue[key].stock > 0) {
|
if (this.productValue[key].stock > 0) {
|
||||||
value = this.attr.productAttr.length ? key.split(",") : [];
|
value = this.attr.productAttr.length ? key.split(",") : [];
|
||||||
|
@ -1040,7 +1040,6 @@
|
||||||
},
|
},
|
||||||
// 授权关闭
|
// 授权关闭
|
||||||
authColse: function(e) {
|
authColse: function(e) {
|
||||||
console.log(e, 'eeeee')
|
|
||||||
this.isShowAuth = e
|
this.isShowAuth = e
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -1116,16 +1115,18 @@
|
||||||
//that.PromotionCode = res.data.code;
|
//that.PromotionCode = res.data.code;
|
||||||
base64src(res.data.code, res => {
|
base64src(res.data.code, res => {
|
||||||
that.PromotionCode = res;
|
that.PromotionCode = res;
|
||||||
console.log('第一张',that.PromotionCode)
|
|
||||||
});
|
});
|
||||||
})
|
}).catch(err => {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 生成二维码;
|
// 生成二维码;
|
||||||
make(uid) {
|
make(uid) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let href = location.href;
|
let href = location.href;
|
||||||
href = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + uid;
|
href = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + uid;
|
||||||
console.log(href)
|
|
||||||
uQRCode.make({
|
uQRCode.make({
|
||||||
canvasId: 'qrcode',
|
canvasId: 'qrcode',
|
||||||
text: href,
|
text: href,
|
||||||
|
@ -1180,45 +1181,6 @@
|
||||||
/**
|
/**
|
||||||
* 生成海报
|
* 生成海报
|
||||||
*/
|
*/
|
||||||
// goPoster: function() {
|
|
||||||
// debugger
|
|
||||||
// let that = this;
|
|
||||||
// that.posters = false;
|
|
||||||
|
|
||||||
// that.$set(that, 'canvasStatus', true);
|
|
||||||
// let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
|
|
||||||
|
|
||||||
// // // #ifndef H5
|
|
||||||
// if (that.isDown)
|
|
||||||
// return that.$util.Tips({
|
|
||||||
// title: '正在下载海报,请稍后再试!'
|
|
||||||
// });
|
|
||||||
// // // #endif
|
|
||||||
// uni.getImageInfo({
|
|
||||||
// src: that.PromotionCode,
|
|
||||||
// fail: function(res) {
|
|
||||||
// console.log(res)
|
|
||||||
// // #ifdef H5
|
|
||||||
// return that.$util.Tips({
|
|
||||||
// title: res
|
|
||||||
// });
|
|
||||||
// // #endif
|
|
||||||
// // #ifdef MP
|
|
||||||
// return that.$util.Tips({
|
|
||||||
// title: '小程序二维码需要发布正式版后才能获取到'
|
|
||||||
// });
|
|
||||||
// // #endif
|
|
||||||
// },
|
|
||||||
// success(res) {
|
|
||||||
// console.log('成功',res)
|
|
||||||
// //生成推广海报
|
|
||||||
// that.$util.PosterCanvas(arr2, that.storeInfo.storeName, that.storeInfo.price, function(tempFilePath) {
|
|
||||||
// that.imagePath = tempFilePath;
|
|
||||||
// that.canvasStatus = true;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
goPoster: function() {
|
goPoster: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.posters = false;
|
that.posters = false;
|
||||||
|
@ -1232,14 +1194,13 @@
|
||||||
let storeName = that.storeInfo.storeName;
|
let storeName = that.storeInfo.storeName;
|
||||||
let price = that.storeInfo.price;
|
let price = that.storeInfo.price;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||||
that.imagePath = tempFilePath;
|
that.imagePath = tempFilePath;
|
||||||
that.canvasStatus = true;
|
that.canvasStatus = true;
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
* 保存到手机相册
|
* 保存到手机相册
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,81 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<view v-if="canvasStatus">
|
|
||||||
<view class="mask"></view>
|
|
||||||
<image :src='imagePath' class="canvas"></image>
|
|
||||||
</view>
|
|
||||||
<view v-else>
|
|
||||||
<canvas style="width:750rpx;height:1190rpx;position: fixed;z-index: -5;" canvas-id="firstCanvas"></canvas>
|
|
||||||
<canvas style="position:fixed;z-index: -5;opacity: 0;" canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
|
||||||
</view>
|
|
||||||
<div @click='clickgg'>点击</div>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
|
||||||
import {
|
|
||||||
HTTP_REQUEST_URL
|
|
||||||
} from '@/config/app.js';
|
|
||||||
export default {
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
imagePath:'',
|
|
||||||
canvasStatus:false,
|
|
||||||
|
|
||||||
qrcodeText: HTTP_REQUEST_URL,
|
|
||||||
qrcodeSize: 129,
|
|
||||||
PromotionCode:''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onReady: function (e) {
|
|
||||||
this.make();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 生成二维码;
|
|
||||||
make() {
|
|
||||||
let that = this;
|
|
||||||
uQRCode.make({
|
|
||||||
canvasId: 'qrcode',
|
|
||||||
text: this.qrcodeText,
|
|
||||||
size: this.qrcodeSize,
|
|
||||||
margin: 10,
|
|
||||||
success: res => {
|
|
||||||
that.PromotionCode = res;
|
|
||||||
},
|
|
||||||
complete: () => {
|
|
||||||
},
|
|
||||||
fail:res=>{
|
|
||||||
that.$util.Tips({
|
|
||||||
title: '海报二维码生成失败!'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clickgg(){
|
|
||||||
let that = this;
|
|
||||||
// ../../static/images/barg002.png
|
|
||||||
let arrImages = ['../../static/images/posterbackgd.png','../../static/images/explosion.png',that.PromotionCode];
|
|
||||||
let storeName = '1十大歌手大好时光的电视广上世纪法国设计风格加工费设计规范技术规范设计规范手机话费csdsdsdsd9';
|
|
||||||
let price = '20';
|
|
||||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
|
||||||
console.log('klklkl');
|
|
||||||
that.imagePath = tempFilePath;
|
|
||||||
that.canvasStatus = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.canvas{
|
|
||||||
position: fixed;
|
|
||||||
width: 512rpx;
|
|
||||||
height: 864rpx;
|
|
||||||
top:50%;
|
|
||||||
left:50%;
|
|
||||||
margin-left: -256rpx;
|
|
||||||
margin-top: -432rpx;
|
|
||||||
z-index: 999;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -282,10 +282,14 @@
|
||||||
import {
|
import {
|
||||||
silenceBindingSpread
|
silenceBindingSpread
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
|
// #ifdef H5
|
||||||
|
import {
|
||||||
|
kefuConfig
|
||||||
|
} from "@/api/public";
|
||||||
import {
|
import {
|
||||||
getWechatConfig
|
getWechatConfig
|
||||||
} from "@/api/public";
|
} from "@/api/public";
|
||||||
|
// #endif
|
||||||
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
|
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
|
||||||
export default {
|
export default {
|
||||||
computed: mapGetters(['isLogin', 'uid']),
|
computed: mapGetters(['isLogin', 'uid']),
|
||||||
|
@ -434,7 +438,6 @@
|
||||||
let arr = res.data.map((item) => {
|
let arr = res.data.map((item) => {
|
||||||
return item.tempId
|
return item.tempId
|
||||||
})
|
})
|
||||||
//console.log(arr)
|
|
||||||
wx.setStorageSync('tempID'+ data, arr);
|
wx.setStorageSync('tempID'+ data, arr);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -627,11 +630,17 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getChatUrL() {
|
getChatUrL() {
|
||||||
|
kefuConfig().then(res => {
|
||||||
|
let data = res.data;
|
||||||
|
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
||||||
|
Cache.set('chatUrl', data.yzfUrl);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getMpChatUrL(){
|
||||||
getWechatConfig().then(res => {
|
getWechatConfig().then(res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
this.$store.commit("SET_CHATURL", data.yzfUrl);
|
||||||
Cache.set('chatUrl', data.yzfUrl);
|
Cache.set('chatUrl', data.yzfUrl);
|
||||||
console.log(data)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// setOpenShare:function(mss){
|
// setOpenShare:function(mss){
|
||||||
|
@ -772,7 +781,7 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
let self = this
|
let self = this
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.getChatUrL();
|
self.$wechat.isWeixin()?self.getMpChatUrL():self.getChatUrL();
|
||||||
// 获取H5 搜索框高度
|
// 获取H5 搜索框高度
|
||||||
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
|
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
|
||||||
appSearchH.boundingClientRect(function(data) {
|
appSearchH.boundingClientRect(function(data) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<view class='list acea-row row-middle'>
|
<view class='list acea-row row-middle'>
|
||||||
<view class='label'>{{articleInfo.categoryName}}</view>
|
<view class='label'>{{articleInfo.categoryName}}</view>
|
||||||
<view class='item'></text>{{articleInfo.createTime}}</view>
|
<view class='item'></text>{{articleInfo.createTime}}</view>
|
||||||
<!-- <view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view> -->
|
<view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='conters'>
|
<view class='conters'>
|
||||||
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
|
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,7 +475,7 @@
|
||||||
let selectValueProductId = that.getSelectValueProductId();
|
let selectValueProductId = that.getSelectValueProductId();
|
||||||
collectAll(that.getSelectValueProductId()).then(res => {
|
collectAll(that.getSelectValueProductId()).then(res => {
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: res,
|
title: '收藏成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
|
@ -344,11 +344,9 @@
|
||||||
this.switchSelect();
|
this.switchSelect();
|
||||||
},
|
},
|
||||||
blurInput:function (index) {
|
blurInput:function (index) {
|
||||||
console.log(66);
|
|
||||||
let item = this.cartList.valid[index];
|
let item = this.cartList.valid[index];
|
||||||
if(!item.cart_num){
|
if(!item.cart_num){
|
||||||
item.cart_num = 1;
|
item.cart_num = 1;
|
||||||
console.log( item.cart_num)
|
|
||||||
this.$set(this.cartList,'valid',this.cartList.valid)
|
this.$set(this.cartList,'valid',this.cartList.valid)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -444,7 +444,6 @@
|
||||||
subDel: function(event) {
|
subDel: function(event) {
|
||||||
let that = this,
|
let that = this,
|
||||||
selectValue = that.selectValue;
|
selectValue = that.selectValue;
|
||||||
console.log(that.selectValue)
|
|
||||||
|
|
||||||
// if (selectValue.length > 0)
|
// if (selectValue.length > 0)
|
||||||
// cartDel(selectValue).then(res => {
|
// cartDel(selectValue).then(res => {
|
||||||
|
@ -478,8 +477,6 @@
|
||||||
selectValue = that.selectValue;
|
selectValue = that.selectValue;
|
||||||
if (selectValue.length > 0) {
|
if (selectValue.length > 0) {
|
||||||
let selectValueProductId = that.getSelectValueProductId();
|
let selectValueProductId = that.getSelectValueProductId();
|
||||||
console.log('selectValueProductId');
|
|
||||||
console.log(selectValueProductId.join(','));
|
|
||||||
// collectAll(that.getSelectValueProductId()).then(res => {
|
// collectAll(that.getSelectValueProductId()).then(res => {
|
||||||
// return that.$util.Tips({
|
// return that.$util.Tips({
|
||||||
// title: res.msg,
|
// title: res.msg,
|
||||||
|
@ -499,7 +496,6 @@
|
||||||
subOrder: function(event) {
|
subOrder: function(event) {
|
||||||
let that = this,
|
let that = this,
|
||||||
selectValue = that.selectValue;
|
selectValue = that.selectValue;
|
||||||
console.log(that.selectValue)
|
|
||||||
if (selectValue.length > 0) {
|
if (selectValue.length > 0) {
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url: '/pages/users/order_confirm/index?new=false&cartId=' + selectValue.join(',')
|
// url: '/pages/users/order_confirm/index?new=false&cartId=' + selectValue.join(',')
|
||||||
|
@ -541,13 +537,10 @@
|
||||||
}
|
}
|
||||||
that.$set(that.cartList, 'valid', valid);
|
that.$set(that.cartList, 'valid', valid);
|
||||||
that.selectValue = selectValue;
|
that.selectValue = selectValue;
|
||||||
console.log('cartList', that.cartList)
|
|
||||||
console.log(that.selectValue)
|
|
||||||
that.switchSelect();
|
that.switchSelect();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkboxChange: function(event) {
|
checkboxChange: function(event) {
|
||||||
console.log(event)
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let value = event.detail.value;
|
let value = event.detail.value;
|
||||||
let valid = that.cartList.valid;
|
let valid = that.cartList.valid;
|
||||||
|
@ -587,8 +580,6 @@
|
||||||
let newArr = that.cartList.valid.filter(item => item.attrStatus);
|
let newArr = that.cartList.valid.filter(item => item.attrStatus);
|
||||||
that.isAllSelect = value.length == newArr.length;
|
that.isAllSelect = value.length == newArr.length;
|
||||||
that.selectValue = value
|
that.selectValue = value
|
||||||
console.log('选中', that.selectValue)
|
|
||||||
console.log('啦啦啦', that.cartList.valid)
|
|
||||||
that.switchSelect();
|
that.switchSelect();
|
||||||
},
|
},
|
||||||
inArray: function(search, array) {
|
inArray: function(search, array) {
|
||||||
|
@ -703,7 +694,6 @@
|
||||||
let valid = res.data.list;
|
let valid = res.data.list;
|
||||||
let loadend = valid.length < that.limit;
|
let loadend = valid.length < that.limit;
|
||||||
let validList = that.$util.SplitArray(valid, that.cartList.valid)
|
let validList = that.$util.SplitArray(valid, that.cartList.valid)
|
||||||
console.log(validList)
|
|
||||||
//console.log(that.$util.toStringValue(validList))
|
//console.log(that.$util.toStringValue(validList))
|
||||||
|
|
||||||
let numSub = [{
|
let numSub = [{
|
||||||
|
|
|
@ -657,13 +657,18 @@
|
||||||
totalPrice: '0',
|
totalPrice: '0',
|
||||||
isAuto: false, //没有授权的不会自动授权
|
isAuto: false, //没有授权的不会自动授权
|
||||||
isShowAuth: false, //是否隐藏授权
|
isShowAuth: false, //是否隐藏授权
|
||||||
id: 0,//订单id
|
id: 0, //订单id
|
||||||
uniId:''
|
uniId: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin', 'chatUrl']),
|
computed: mapGetters(['isLogin', 'chatUrl']),
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
if (!options.order_id && !options.uniId) return this.$util.Tips({title:'缺少参数'},{tab:3,url:1});
|
if (!options.order_id && !options.uniId) return this.$util.Tips({
|
||||||
|
title: '缺少参数'
|
||||||
|
}, {
|
||||||
|
tab: 3,
|
||||||
|
url: 1
|
||||||
|
});
|
||||||
this.$set(this, 'order_id', options.order_id);
|
this.$set(this, 'order_id', options.order_id);
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -696,7 +701,7 @@
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
kefuClick(){
|
kefuClick() {
|
||||||
location.href = this.chatUrl;
|
location.href = this.chatUrl;
|
||||||
},
|
},
|
||||||
goGoodCall() {
|
goGoodCall() {
|
||||||
|
@ -824,8 +829,9 @@
|
||||||
that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
|
that.$set(that, 'evaluate', _type == 3 ? 3 : 0);
|
||||||
that.$set(that, 'system_store', res.data.systemStore);
|
that.$set(that, 'system_store', res.data.systemStore);
|
||||||
that.$set(that, 'id', res.data.id);
|
that.$set(that, 'id', res.data.id);
|
||||||
let cartInfo = res.data.cartInfo,newCartInfo = [];
|
let cartInfo = res.data.cartInfo,
|
||||||
cartInfo.forEach((item,index)=>{
|
newCartInfo = [];
|
||||||
|
cartInfo.forEach((item, index) => {
|
||||||
newCartInfo.push(item.info);
|
newCartInfo.push(item.info);
|
||||||
});
|
});
|
||||||
that.$set(that, 'cartInfo', newCartInfo);
|
that.$set(that, 'cartInfo', newCartInfo);
|
||||||
|
@ -847,7 +853,11 @@
|
||||||
* 生成二维码
|
* 生成二维码
|
||||||
*/
|
*/
|
||||||
markCode(text) {
|
markCode(text) {
|
||||||
qrcodeApi({ height: '145', text: text, width: '145' }).then(res => {
|
qrcodeApi({
|
||||||
|
height: '145',
|
||||||
|
text: text,
|
||||||
|
width: '145'
|
||||||
|
}).then(res => {
|
||||||
this.codeImg = res.data.code
|
this.codeImg = res.data.code
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -859,7 +869,7 @@
|
||||||
copy: function() {
|
copy: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: this.orderInfo.order_id
|
data: this.orderInfo.orderId
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -912,11 +922,15 @@
|
||||||
*/
|
*/
|
||||||
goOrderConfirm: function() {
|
goOrderConfirm: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
orderAgain(that.orderInfo.unique).then(res => {
|
orderAgain(that.orderInfo.orderId).then(res => {
|
||||||
return uni.navigateTo({
|
return uni.navigateTo({
|
||||||
url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId + '&again=true&new=true&addAgain=true'
|
url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId + '&again=true&new=true&addAgain=true'
|
||||||
});
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: err
|
||||||
});
|
});
|
||||||
|
})
|
||||||
},
|
},
|
||||||
confirmOrder: function() {
|
confirmOrder: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<view class='payment-status'>
|
<view class='payment-status'>
|
||||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||||
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
|
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
|
||||||
<view class='iconfont icons icon-iconfontguanbi bg-color' v-else></view>
|
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
|
||||||
<!-- 失败时:订单支付失败 -->
|
<!-- 失败时:订单支付失败 -->
|
||||||
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
|
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
|
||||||
<view class='status' v-else>订单创建成功</view>
|
<view class='status' v-else>订单创建成功</view>
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view>下单时间</view>
|
<view>下单时间</view>
|
||||||
<view class='itemCom'>{{order_pay_info.createTime}}</view>
|
<view class='itemCom'>{{order_pay_info.createTime?order_pay_info.createTime:'-'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='item acea-row row-between-wrapper'>
|
<view class='item acea-row row-between-wrapper'>
|
||||||
<view>支付方式</view>
|
<view>支付方式</view>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!--失败时: 重新购买 -->
|
<!--失败时: 重新购买 -->
|
||||||
<view @tap="goOrderDetails" v-if="status==0">
|
<view @tap="goOrderDetails">
|
||||||
<button formType="submit" class='returnBnt bg-color' hover-class='none'>查看订单</button>
|
<button formType="submit" class='returnBnt bg-color' hover-class='none'>查看订单</button>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
|
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
|
||||||
|
@ -179,6 +179,10 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.icon-iconfontguanbi{
|
||||||
|
background-color: #999 !important;
|
||||||
|
text-shadow: none !important;
|
||||||
|
}
|
||||||
.payment-status {
|
.payment-status {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: 195rpx 30rpx 0 30rpx;
|
margin: 195rpx 30rpx 0 30rpx;
|
||||||
|
|
|
@ -115,9 +115,7 @@
|
||||||
</button>
|
</button>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view style="height: 50rpx;"></view> -->
|
|
||||||
<img src="/static/images/support.png" alt="" class='support'>
|
<img src="/static/images/support.png" alt="" class='support'>
|
||||||
|
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
@ -347,7 +345,6 @@
|
||||||
margin: 54rpx auto;
|
margin: 54rpx auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.new-users {
|
.new-users {
|
||||||
.head {
|
.head {
|
||||||
padding-top: 30rpx;
|
padding-top: 30rpx;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="CommissionRank">
|
<view class="CommissionRank">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="rank" v-if="position&&position<100 ">您目前的排名<text class="num">{{position}}</text>名</view>
|
<view class="rank" v-if="position">您目前的排名<text class="num">{{position}}</text>名</view>
|
||||||
<view class="rank" v-else>您目前暂无排名</view>
|
<view class="rank" v-else>您目前暂无排名</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
active: 0,
|
active: 0,
|
||||||
rankList: [],
|
rankList: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 20,
|
||||||
loadend: false,
|
loadend: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
loadTitle: '加载更多',
|
loadTitle: '加载更多',
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
this.loadend = false;
|
this.loadend = false;
|
||||||
this.$set(this, 'rankList', []);
|
this.$set(this, 'rankList', []);
|
||||||
this.getBrokerageRankList();
|
this.getBrokerageRankList();
|
||||||
this.getBrokerageRankNumber();
|
this.getBrokerageRankNumber(this.type);
|
||||||
},
|
},
|
||||||
getBrokerageRankNumber(type) {
|
getBrokerageRankNumber(type) {
|
||||||
brokerageRankNumber({
|
brokerageRankNumber({
|
||||||
|
@ -124,20 +124,13 @@
|
||||||
type: this.type
|
type: this.type
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let list = res.data;
|
let list = res.data;
|
||||||
let loadend = list.length < this.limit;
|
let loadend = list.length <= this.limit;
|
||||||
this.rankList = this.$util.SplitArray(list, this.rankList);
|
this.rankList.push.apply(this.rankList, list);
|
||||||
this.$set(that,'rankList',this.rankList);
|
|
||||||
this.loadend = loadend;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
|
this.loadend = loadend;
|
||||||
// let list = res.data;
|
this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
||||||
// let loadend = list.length < this.limit;
|
this.$set(this, 'rankList', this.rankList);
|
||||||
// this.rankList.push.apply(this.rankList, list);
|
//this.position = res.data.position;
|
||||||
// this.loading = false;
|
|
||||||
// this.loadend = loadend;
|
|
||||||
// this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
|
||||||
// this.$set(this, 'rankList', this.rankList);
|
|
||||||
// this.position = res.data.position;
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.loadTitle = '加载更多';
|
this.loadTitle = '加载更多';
|
||||||
|
|
|
@ -185,13 +185,11 @@
|
||||||
});
|
});
|
||||||
value.productScore = product_score;
|
value.productScore = product_score;
|
||||||
value.serviceScore = service_score;
|
value.serviceScore = service_score;
|
||||||
console.log("that.pics");
|
value.pics = that.pics.length>0?JSON.stringify(that.pics):'';
|
||||||
let aa = JSON.stringify(that.pics);
|
|
||||||
console.log(typeof aa);
|
|
||||||
value.pics = JSON.stringify(that.pics);
|
|
||||||
value.productId = that.productId;
|
value.productId = that.productId;
|
||||||
value.oid = that.evaluateId;
|
value.oid = that.evaluateId;
|
||||||
value.unique = that.unique;
|
value.unique = that.unique;
|
||||||
|
value.sku = that.productInfo.attrInfo.suk;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "正在发布评论……"
|
title: "正在发布评论……"
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,8 +11,16 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row-right">
|
<div class="row-right">
|
||||||
<div>
|
<div>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef MP -->
|
||||||
|
<view class="store-phone" @click="call(item.phone)"><text class="iconfont icon-dadianhua01"></text></view>
|
||||||
|
<!-- #endif -->
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div>
|
||||||
|
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||||
|
</div> -->
|
||||||
<div class="store-distance" @click.stop="showMaoLocation(item)">
|
<div class="store-distance" @click.stop="showMaoLocation(item)">
|
||||||
<span class="addressTxt" v-if="item.range">距离{{ item.range }}千米</span>
|
<span class="addressTxt" v-if="item.range">距离{{ item.range }}千米</span>
|
||||||
<span class="addressTxt" v-else>查看地图</span>
|
<span class="addressTxt" v-else>查看地图</span>
|
||||||
|
@ -89,12 +97,18 @@
|
||||||
this.getList();
|
this.getList();
|
||||||
} else {
|
} else {
|
||||||
this.selfLocation();
|
this.selfLocation();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
// this.$scroll(this.$refs.container, () => {
|
// this.$scroll(this.$refs.container, () => {
|
||||||
// !this.loading && this.getList();
|
// !this.loading && this.getList();
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
call(phone) {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: phone,
|
||||||
|
});
|
||||||
|
},
|
||||||
selfLocation() {
|
selfLocation() {
|
||||||
let self = this
|
let self = this
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
|
|
|
@ -141,7 +141,6 @@
|
||||||
DelPic:function(e){
|
DelPic:function(e){
|
||||||
let index = e, that = this;
|
let index = e, that = this;
|
||||||
that.refund_reason_wap_imgPath.splice(index, 1);
|
that.refund_reason_wap_imgPath.splice(index, 1);
|
||||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
|
@ -150,10 +149,7 @@
|
||||||
uploadpic:function(){
|
uploadpic:function(){
|
||||||
let that=this;
|
let that=this;
|
||||||
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
|
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
|
||||||
// that.refund_reason_wap_img.push(res.data.url);
|
|
||||||
that.refund_reason_wap_imgPath.push(res.data.url);
|
that.refund_reason_wap_imgPath.push(res.data.url);
|
||||||
// that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
|
|
||||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -161,11 +157,9 @@
|
||||||
* 申请退货
|
* 申请退货
|
||||||
*/
|
*/
|
||||||
subRefund:function(e){
|
subRefund:function(e){
|
||||||
|
|
||||||
let that = this, value = e.detail.value;
|
let that = this, value = e.detail.value;
|
||||||
console.log(that.refund_reason_wap_imgPath.join(','));
|
|
||||||
//收集form表单
|
//收集form表单
|
||||||
if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
||||||
orderRefundVerify({
|
orderRefundVerify({
|
||||||
text: that.RefundArray[that.index] || '',
|
text: that.RefundArray[that.index] || '',
|
||||||
refund_reason_wap_explain: value.refund_reason_wap_explain,
|
refund_reason_wap_explain: value.refund_reason_wap_explain,
|
||||||
|
|
|
@ -304,7 +304,7 @@
|
||||||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||||
// that.isShowCode = true;
|
// that.isShowCode = true;
|
||||||
// }
|
// }
|
||||||
that.$util.Tips({title:res.message});
|
that.$util.Tips({title:res});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
navTap: function(index) {
|
navTap: function(index) {
|
||||||
|
@ -347,7 +347,11 @@
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
}).catch(e => {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: e
|
||||||
|
});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
|
|
|
@ -153,7 +153,9 @@
|
||||||
getCouponsOrderPrice,
|
getCouponsOrderPrice,
|
||||||
orderCreate,
|
orderCreate,
|
||||||
postOrderComputed,
|
postOrderComputed,
|
||||||
orderPay
|
orderPay,
|
||||||
|
wechatOrderPay,
|
||||||
|
wechatQueryPayResult
|
||||||
} from '@/api/order.js';
|
} from '@/api/order.js';
|
||||||
import {
|
import {
|
||||||
getAddressDefault,
|
getAddressDefault,
|
||||||
|
@ -211,11 +213,11 @@
|
||||||
payStatus: 1,
|
payStatus: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "线下支付",//offlinePayStatu:1开启线下支付;2关闭;offlinePostage:true有邮费
|
"name": "线下支付", //offlinePayStatu:1开启线下支付;2关闭;offlinePostage:true有邮费
|
||||||
"icon": "icon-yinhangqia",
|
"icon": "icon-yinhangqia",
|
||||||
value: 'offline',
|
value: 'offline',
|
||||||
title: '线下支付',
|
title: '线下支付',
|
||||||
payStatus: 2,
|
payStatus: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payType: 'weixin', //支付方式
|
payType: 'weixin', //支付方式
|
||||||
|
@ -268,7 +270,7 @@
|
||||||
offlinePostage: "",
|
offlinePostage: "",
|
||||||
isAuto: false, //没有授权的不会自动授权
|
isAuto: false, //没有授权的不会自动授权
|
||||||
isShowAuth: false, //是否隐藏授权
|
isShowAuth: false, //是否隐藏授权
|
||||||
from: '',
|
payChannel: '',
|
||||||
news: true,
|
news: true,
|
||||||
again: false,
|
again: false,
|
||||||
addAgain: false,
|
addAgain: false,
|
||||||
|
@ -280,10 +282,10 @@
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.from = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
this.from = 'routine'
|
this.payChannel = 'routine'
|
||||||
// #endif
|
// #endif
|
||||||
if (!options.cartId) return this.$util.Tips({
|
if (!options.cartId) return this.$util.Tips({
|
||||||
title: '请选择要购买的商品'
|
title: '请选择要购买的商品'
|
||||||
|
@ -306,9 +308,7 @@
|
||||||
this.getaddressInfo();
|
this.getaddressInfo();
|
||||||
this.getConfirm();
|
this.getConfirm();
|
||||||
//调用子页面方法授权后执行获取地址列表
|
//调用子页面方法授权后执行获取地址列表
|
||||||
this.$nextTick(function() {
|
this.$nextTick(function() {})
|
||||||
this.$refs.addressWindow.getAddressList();
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
// #ifdef H5 || APP-PLUS
|
// #ifdef H5 || APP-PLUS
|
||||||
toLogin();
|
toLogin();
|
||||||
|
@ -412,7 +412,6 @@
|
||||||
shippingType: parseInt(shippingType) + 1,
|
shippingType: parseInt(shippingType) + 1,
|
||||||
payType: this.payType
|
payType: this.payType
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
|
||||||
let result = res.data.result.result;
|
let result = res.data.result.result;
|
||||||
if (result) {
|
if (result) {
|
||||||
this.totalPrice = result.orderId.payPrice;
|
this.totalPrice = result.orderId.payPrice;
|
||||||
|
@ -511,7 +510,7 @@
|
||||||
*/
|
*/
|
||||||
getConfirm: function() {
|
getConfirm: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
orderConfirm(that.cartId,that.news,this.addAgain,this.secKill,this.combination,this.bargain).then(res => {
|
orderConfirm(that.cartId, that.news, this.addAgain, this.secKill, this.combination, this.bargain).then(res => {
|
||||||
that.$set(that, 'userInfo', res.data.userInfo);
|
that.$set(that, 'userInfo', res.data.userInfo);
|
||||||
that.$set(that, 'integral', res.data.userInfo.integral);
|
that.$set(that, 'integral', res.data.userInfo.integral);
|
||||||
that.$set(that, 'cartInfo', res.data.cartInfo);
|
that.$set(that, 'cartInfo', res.data.cartInfo);
|
||||||
|
@ -523,11 +522,11 @@
|
||||||
that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice), parseFloat(res.data
|
that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice), parseFloat(res.data
|
||||||
.priceGroup.storePostage)));
|
.priceGroup.storePostage)));
|
||||||
that.$set(that, 'seckillId', parseInt(res.data.secKillId));
|
that.$set(that, 'seckillId', parseInt(res.data.secKillId));
|
||||||
that.$set(that, 'store_self_mention', res.data.storeSelfMention == 'true'?true:false);
|
that.$set(that, 'store_self_mention', res.data.storeSelfMention == 'true' ? true : false);
|
||||||
that.cartArr[1].title = '可用余额:' + res.data.userInfo.nowMoney;
|
that.cartArr[1].title = '可用余额:' + res.data.userInfo.nowMoney;
|
||||||
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
|
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
|
||||||
that.cartArr[1].payStatus = res.data.yuePayStatus || 0
|
that.cartArr[1].payStatus = res.data.yuePayStatus || 0
|
||||||
if (res.data.offlinePayStatus == 2) {
|
if (res.data.offlinePayStatus == 1) {
|
||||||
that.cartArr[2].payStatus = 1
|
that.cartArr[2].payStatus = 1
|
||||||
} else {
|
} else {
|
||||||
that.cartArr[2].payStatus = 0
|
that.cartArr[2].payStatus = 0
|
||||||
|
@ -536,7 +535,7 @@
|
||||||
// that.$set(that, 'cartArr', that.cartArr);
|
// that.$set(that, 'cartArr', that.cartArr);
|
||||||
that.$set(that, 'ChangePrice', that.totalPrice);
|
that.$set(that, 'ChangePrice', that.totalPrice);
|
||||||
that.getBargainId();
|
that.getBargainId();
|
||||||
if(!that.secKill) that.getCouponList();
|
if (!that.secKill) that.getCouponList();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
return this.$util.Tips({
|
return this.$util.Tips({
|
||||||
title: err
|
title: err
|
||||||
|
@ -555,8 +554,8 @@
|
||||||
let BargainId = 0;
|
let BargainId = 0;
|
||||||
let combinationId = 0;
|
let combinationId = 0;
|
||||||
cartINfo.forEach(function(value, index, cartINfo) {
|
cartINfo.forEach(function(value, index, cartINfo) {
|
||||||
BargainId = cartINfo[index].bargainId,
|
BargainId = cartINfo[index].bargainId || 0,
|
||||||
combinationId = cartINfo[index].combinationId
|
combinationId = cartINfo[index].combinationId || 0
|
||||||
})
|
})
|
||||||
that.$set(that, 'BargainId', parseInt(BargainId));
|
that.$set(that, 'BargainId', parseInt(BargainId));
|
||||||
that.$set(that, 'combinationId', parseInt(combinationId));
|
that.$set(that, 'combinationId', parseInt(combinationId));
|
||||||
|
@ -586,7 +585,7 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.addressId) {
|
if (that.addressId) {
|
||||||
getAddressDetail(that.addressId).then(res => {
|
getAddressDetail(that.addressId).then(res => {
|
||||||
if(res.data){
|
if (res.data) {
|
||||||
res.data.isDefault = parseInt(res.data.isDefault);
|
res.data.isDefault = parseInt(res.data.isDefault);
|
||||||
that.addressInfo = res.data || {};
|
that.addressInfo = res.data || {};
|
||||||
that.addressId = res.data.id || 0;
|
that.addressId = res.data.id || 0;
|
||||||
|
@ -595,7 +594,7 @@
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
getAddressDefault().then(res => {
|
getAddressDefault().then(res => {
|
||||||
if(res.data){
|
if (res.data) {
|
||||||
res.data.isDefault = parseInt(res.data.isDefault);
|
res.data.isDefault = parseInt(res.data.isDefault);
|
||||||
that.addressInfo = res.data || {};
|
that.addressInfo = res.data || {};
|
||||||
that.addressId = res.data.id || 0;
|
that.addressId = res.data.id || 0;
|
||||||
|
@ -627,7 +626,8 @@
|
||||||
that.textareaStatus = false;
|
that.textareaStatus = false;
|
||||||
that.address.address = true;
|
that.address.address = true;
|
||||||
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
|
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
|
||||||
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain;
|
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' +
|
||||||
|
this.bargain;
|
||||||
},
|
},
|
||||||
realName: function(e) {
|
realName: function(e) {
|
||||||
this.contacts = e.detail.value;
|
this.contacts = e.detail.value;
|
||||||
|
@ -638,35 +638,175 @@
|
||||||
payment: function(data) {
|
payment: function(data) {
|
||||||
let that = this;
|
let that = this;
|
||||||
orderCreate(that.orderKey, data).then(res => {
|
orderCreate(that.orderKey, data).then(res => {
|
||||||
let result = res.data.result,
|
that.getOrderPay(res.data.orderNo, '支付成功');
|
||||||
status = res.data.status,
|
// if(that.totalPrice===0)return that.$util.Tips({
|
||||||
orderId = result.orderId,
|
// title: '支付成功',
|
||||||
jsConfig = res.data.jsConfig,
|
// icon: 'success'
|
||||||
message = res.data.message;
|
// });
|
||||||
if(that.totalPrice===0)return that.$util.Tips({
|
|
||||||
title: '支付成功',
|
}).catch(err => {
|
||||||
icon: 'success'
|
uni.hideLoading();
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: err
|
||||||
});
|
});
|
||||||
if(that.news == "false"){
|
});
|
||||||
orderPay({
|
// orderCreate(that.orderKey, data).then(res => {
|
||||||
'paytype': that.payType,
|
// let result = res.data.result,
|
||||||
'uni':res.data.result.key,
|
// status = res.data.status,
|
||||||
|
// orderId = result.orderId,
|
||||||
|
// jsConfig = res.data.jsConfig,
|
||||||
|
// message = res.data.message;
|
||||||
|
// if(that.totalPrice===0)return that.$util.Tips({
|
||||||
|
// title: '支付成功',
|
||||||
|
// icon: 'success'
|
||||||
|
// });
|
||||||
|
// if(that.news == "false"){
|
||||||
|
// orderPay({
|
||||||
|
// 'paytype': that.payType,
|
||||||
|
// 'uni':res.data.result.key,
|
||||||
|
// // #ifdef MP
|
||||||
|
// 'from': 'routine',
|
||||||
|
// // #endif
|
||||||
|
// // #ifdef H5 || APP-PLUS
|
||||||
|
// 'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||||
|
// // #endif
|
||||||
|
// }).then(res=>{
|
||||||
|
// result = res.data.result;
|
||||||
|
// status = res.data.status;
|
||||||
|
// orderId = result.orderId;
|
||||||
|
// jsConfig = res.data.jsConfig;
|
||||||
|
// message = res.data.message;
|
||||||
|
// that.getPayType(status,orderId,message,jsConfig);
|
||||||
|
// })
|
||||||
|
// }else{
|
||||||
|
// that.getPayType(status,orderId,message,jsConfig);
|
||||||
|
// }
|
||||||
|
// }).catch(err => {
|
||||||
|
// uni.hideLoading();
|
||||||
|
// return that.$util.Tips({
|
||||||
|
// title: err
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
getOrderPay: function(orderNo, message) {
|
||||||
|
let that = this;
|
||||||
|
let goPages = '/pages/order_pay_status/index?order_id=' + orderNo + '&msg=' + message;
|
||||||
|
wechatOrderPay({
|
||||||
|
orderNo: orderNo,
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
'from': 'routine',
|
payChannel: 'routine',
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5 || APP-PLUS
|
// #ifdef H5 || APP-PLUS
|
||||||
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
payChannel: that.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||||
// #endif
|
// #endif
|
||||||
}).then(res=>{
|
payType: that.payType
|
||||||
result = res.data.result;
|
}).then(res => {
|
||||||
status = res.data.status;
|
let jsConfig = res.data.jsConfig;
|
||||||
orderId = result.orderId;
|
switch (res.data.payType) {
|
||||||
jsConfig = res.data.jsConfig;
|
case 'weixin':
|
||||||
message = res.data.message;
|
// #ifdef MP
|
||||||
that.getPayType(status,orderId,message,jsConfig);
|
uni.requestPayment({
|
||||||
|
timeStamp: jsConfig.timeStamp,
|
||||||
|
nonceStr: jsConfig.nonceStr,
|
||||||
|
package: jsConfig.packages,
|
||||||
|
signType: jsConfig.signType,
|
||||||
|
paySign: jsConfig.paySign,
|
||||||
|
success: function(ress) {
|
||||||
|
uni.hideLoading();
|
||||||
|
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'success'
|
||||||
|
}, {
|
||||||
|
tab: 4,
|
||||||
|
url: goPages
|
||||||
|
});
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'success'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
uni.hideLoading();
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: '取消支付'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages + '&status=2'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
complete: function(e) {
|
||||||
|
uni.hideLoading();
|
||||||
|
//关闭当前页面跳转至订单状态
|
||||||
|
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||||
|
title: '取消支付'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages + '&status=2'
|
||||||
|
});
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}else{
|
// #endif
|
||||||
that.getPayType(status,orderId,message,jsConfig);
|
// #ifdef H5
|
||||||
|
let data = {
|
||||||
|
timestamp: jsConfig.timeStamp,
|
||||||
|
nonceStr: jsConfig.nonceStr,
|
||||||
|
package: jsConfig.packages,
|
||||||
|
signType: jsConfig.signType,
|
||||||
|
paySign: jsConfig.paySign
|
||||||
|
};
|
||||||
|
that.$wechat.pay(data).then(res => {
|
||||||
|
if (res.errMsg == 'chooseWXPay:cancel') {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: '取消支付'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages + '&status=2'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
wechatQueryPayResult({
|
||||||
|
orderNo: orderNo
|
||||||
|
}).then(res => {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: '支付成功',
|
||||||
|
icon: 'success'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages
|
||||||
|
});
|
||||||
|
}).cache(err => {
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
break;
|
||||||
|
case 'yue':
|
||||||
|
uni.hideLoading();
|
||||||
|
return that.$util.Tips({
|
||||||
|
title: message
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages + '&status=1'
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'weixinh5':
|
||||||
|
uni.hideLoading();
|
||||||
|
that.$util.Tips({
|
||||||
|
title: '订单创建成功'
|
||||||
|
}, {
|
||||||
|
tab: 5,
|
||||||
|
url: goPages + '&status=0'
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
location.href = jsConfig.mwebUrl;
|
||||||
|
}, 100)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
@ -675,7 +815,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getPayType: function(status,orderId,message,jsConfig){
|
getPayType: function(status, orderId, message, jsConfig) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + message;
|
let goPages = '/pages/order_pay_status/index?order_id=' + orderId + '&msg=' + message;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
@ -761,12 +901,12 @@
|
||||||
let jsConfigAgain = jsConfig;
|
let jsConfigAgain = jsConfig;
|
||||||
let packages = 'prepay_id=' + jsConfigAgain.prepayId;
|
let packages = 'prepay_id=' + jsConfigAgain.prepayId;
|
||||||
let data = {
|
let data = {
|
||||||
timestamp:jsConfigAgain.timeStamp,
|
timestamp: jsConfigAgain.timeStamp,
|
||||||
nonceStr:jsConfigAgain.nonceStr,
|
nonceStr: jsConfigAgain.nonceStr,
|
||||||
package:packages,
|
package: packages,
|
||||||
signType:jsConfigAgain.signType,
|
signType: jsConfigAgain.signType,
|
||||||
paySign:jsConfigAgain.paySign,
|
paySign: jsConfigAgain.paySign,
|
||||||
h5PayUrl:jsConfigAgain.h5PayUrl
|
h5PayUrl: jsConfigAgain.h5PayUrl
|
||||||
};
|
};
|
||||||
this.$wechat.pay(data).then(res => {
|
this.$wechat.pay(data).then(res => {
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
|
@ -788,7 +928,6 @@
|
||||||
break;
|
break;
|
||||||
case 'PAY_DEFICIENCY':
|
case 'PAY_DEFICIENCY':
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
//余额不足
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: message
|
title: message
|
||||||
}, {
|
}, {
|
||||||
|
@ -799,7 +938,7 @@
|
||||||
case "WECHAT_H5_PAY": //网页版公众号支付
|
case "WECHAT_H5_PAY": //网页版公众号支付
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
let domain = encodeURIComponent(location.href);
|
let domain = encodeURIComponent(location.href);
|
||||||
let urls = jsConfigAgain.h5PayUrl + '&redirect_url='+ domain;
|
let urls = jsConfigAgain.h5PayUrl + '&redirect_url=' + domain;
|
||||||
location.href = urls;
|
location.href = urls;
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '支付成功',
|
title: '支付成功',
|
||||||
|
@ -857,24 +996,27 @@
|
||||||
seckillId: that.seckillId,
|
seckillId: that.seckillId,
|
||||||
mark: that.mark,
|
mark: that.mark,
|
||||||
storeId: that.system_store.id || 0,
|
storeId: that.system_store.id || 0,
|
||||||
'from': that.from,
|
|
||||||
shippingType: that.$util.$h.Add(that.shippingType, 1),
|
shippingType: that.$util.$h.Add(that.shippingType, 1),
|
||||||
isNew: that.news
|
isNew: that.news,
|
||||||
|
payChannel: that.payChannel
|
||||||
|
|
||||||
};
|
};
|
||||||
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice)) return that.$util.Tips({
|
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice)) return that.$util
|
||||||
|
.Tips({
|
||||||
title: '余额不足!'
|
title: '余额不足!'
|
||||||
});
|
});
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '订单支付中'
|
title: '订单支付中'
|
||||||
});
|
});
|
||||||
// #ifdef MP
|
// // #ifdef MP
|
||||||
openPaySubscribe().then(() => {
|
// openPaySubscribe().then(() => {
|
||||||
|
// that.payment(data);
|
||||||
|
// });
|
||||||
|
// // #endif
|
||||||
|
// // #ifndef MP
|
||||||
|
// that.payment(data);
|
||||||
|
// // #endif
|
||||||
that.payment(data);
|
that.payment(data);
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
// #ifndef MP
|
|
||||||
that.payment(data);
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,6 @@
|
||||||
this.isShowAuth = e
|
this.isShowAuth = e
|
||||||
},
|
},
|
||||||
setSort: function(sortKey,isAsc) {
|
setSort: function(sortKey,isAsc) {
|
||||||
console.log(sortKey);
|
|
||||||
let that = this;
|
let that = this;
|
||||||
that.isAsc = isAsc;
|
that.isAsc = isAsc;
|
||||||
that.sort = sortKey+isAsc;
|
that.sort = sortKey+isAsc;
|
||||||
|
|
|
@ -81,7 +81,6 @@
|
||||||
again() {
|
again() {
|
||||||
this.codeUrl =
|
this.codeUrl =
|
||||||
VUE_APP_API_URL + "/captcha?" + this.keyCode + Date.parse(new Date());
|
VUE_APP_API_URL + "/captcha?" + this.keyCode + Date.parse(new Date());
|
||||||
console.log(this.codeUrl);
|
|
||||||
},
|
},
|
||||||
getCode() {
|
getCode() {
|
||||||
getCodeApi()
|
getCodeApi()
|
||||||
|
@ -142,7 +141,6 @@
|
||||||
that.sendCode();
|
that.sendCode();
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
console.log(res, 'res')
|
|
||||||
// if (res.data.status === 402) {
|
// if (res.data.status === 402) {
|
||||||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||||
// that.isShowCode = true;
|
// that.isShowCode = true;
|
||||||
|
|
|
@ -2,22 +2,20 @@
|
||||||
<view>
|
<view>
|
||||||
<view class='coupon-list' v-if="couponsList.length">
|
<view class='coupon-list' v-if="couponsList.length">
|
||||||
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index">
|
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index">
|
||||||
<view class='money' :class='item.isValid === false ? "moneyGray" : ""'>
|
<view class='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : ''">
|
||||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||||
<view class="pic-num">满{{ item.minPrice }}元可用</view>
|
<view class="pic-num">满{{ item.minPrice }}元可用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='condition line1'>
|
<view class='condition line2'>
|
||||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-if="item.useType === 1">通用劵</view>
|
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-if="item.useType === 1">通用</span>
|
||||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 2">商品券</view>
|
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 2">商品</span>
|
||||||
<view class="line-title" :class="item.isValid === false ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 3">品类券</view>
|
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 3">品类</span>
|
||||||
|
<span>{{item.name}}</span>
|
||||||
<view>{{item.name}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class='data acea-row row-between-wrapper'>
|
<view class='data acea-row row-between-wrapper'>
|
||||||
<view>{{item.startTime}} ~ {{item.endTime}}</view>
|
<view>{{item.useStartTimeStr}}~{{item.useEndTimeStr}}</view>
|
||||||
<view class='bnt gray' v-if="item.isValid===false">已过期</view>
|
<view class='bnt' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart'?'gray':'bg-color'">{{item.validStr | validStrFilter}}</view>
|
||||||
<view class='bnt bg-color' v-else>可使用</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -55,6 +53,17 @@
|
||||||
// #endif
|
// #endif
|
||||||
home
|
home
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
validStrFilter(status) {
|
||||||
|
const statusMap = {
|
||||||
|
'usable': '可用',
|
||||||
|
'unusable': '已用',
|
||||||
|
'overdue': '过期',
|
||||||
|
'notStart': '未开始'
|
||||||
|
}
|
||||||
|
return statusMap[status]
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
couponsList: [],
|
couponsList: [],
|
||||||
|
@ -111,24 +120,27 @@
|
||||||
|
|
||||||
.pic-num {
|
.pic-num {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 0.24rem;
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
.coupon-list .item .text{
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
.coupon-list .item .text .condition{
|
.coupon-list .item .text .condition{
|
||||||
display: flex;
|
/* display: flex;
|
||||||
align-items: center;
|
align-items: center; */
|
||||||
}
|
}
|
||||||
.condition .line-title {
|
.condition .line-title {
|
||||||
/* width: 90rpx; */
|
width: 90rpx;
|
||||||
height: 40rpx !important;
|
height: 40rpx !important;
|
||||||
line-height: 40rpx !important;
|
line-height: 40rpx !important;
|
||||||
padding: 0 10rpx;
|
padding: 2rpx 10rpx;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: rgba(255, 247, 247, 1);
|
background: rgba(255, 247, 247, 1);
|
||||||
border: 1px solid rgba(232, 51, 35, 1);
|
border: 1px solid rgba(232, 51, 35, 1);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
border-radius: 22rpx;
|
border-radius: 20rpx;
|
||||||
font-size: 20rpx !important;
|
font-size: 18rpx !important;
|
||||||
color: #e83323;
|
color: #e83323;
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,15 @@
|
||||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='condition line1'>
|
<view class='condition line2'>
|
||||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-if='item.type===0'>通用劵</span>
|
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-if='item.useType===1'>通用</span>
|
||||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else-if='item.type===1'>品类券</span>
|
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else-if='item.useType===3'>品类</span>
|
||||||
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品券</span>
|
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品</span>
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
</view>
|
</view>
|
||||||
<view class='data acea-row row-between-wrapper'>
|
<view class='data acea-row row-between-wrapper'>
|
||||||
<view>{{ item.receiveStartTime ? item.receiveStartTime + "-" : ""}}{{ item.receiveEndTime }}</view>
|
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
|
||||||
|
<view v-else>{{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}}</view>
|
||||||
<view class='bnt gray' v-if="item.isUse==true">已领取</view>
|
<view class='bnt gray' v-if="item.isUse==true">已领取</view>
|
||||||
<view class='bnt bg-color' v-else @click='getCoupon(item.id,index)'>立即领取</view>
|
<view class='bnt bg-color' v-else @click='getCoupon(item.id,index)'>立即领取</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -1,475 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<form @submit="formSubmit" report-submit='true'>
|
|
||||||
<view class='personal-data'>
|
|
||||||
<!-- <view class="wrapper">
|
|
||||||
<view class="title">管理我的账号</view>
|
|
||||||
<view class="wrapList">
|
|
||||||
<view class="item acea-row row-between-wrapper" :class="item.uid === userInfo.uid ? 'on' : ''" v-for="(item,index) in switchUserInfo"
|
|
||||||
:key="index" @click='switchAccounts(index)'>
|
|
||||||
<view class="picTxt acea-row row-between-wrapper">
|
|
||||||
<view class="pictrue" @click.stop='uploadpic' v-if='item.uid === userInfo.uid'>
|
|
||||||
<image :src='item.avatar'></image>
|
|
||||||
<image src='../../../static/images/alter.png' class="alter"></image>
|
|
||||||
</view>
|
|
||||||
<view class="pictrue" v-else>
|
|
||||||
<image :src='item.avatar'></image>
|
|
||||||
</view>
|
|
||||||
<view class="text">
|
|
||||||
<view class="name line1">{{ item.nickname }}</view>
|
|
||||||
<view class="phone" v-if="item.phone && item.user_type !='h5'">绑定手机号:{{ item.phone }}</view>
|
|
||||||
<view class="phone" v-else-if="item.phone && item.user_type =='h5'">账号:{{ item.phone }}</view>
|
|
||||||
<view class="phone" v-else>暂未绑定手机号</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="currentBnt acea-row row-center-wrapper font-color" v-if='item.uid === userInfo.uid'>
|
|
||||||
当前账号
|
|
||||||
</view>
|
|
||||||
<view class="bnt font-color acea-row row-center-wrapper" v-else>
|
|
||||||
使用账号
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view class='list'>
|
|
||||||
<view class="item acea-row row-between-wrapper">
|
|
||||||
<view>头像</view>
|
|
||||||
<view class="pictrue" @click.stop='uploadpic'>
|
|
||||||
<image :src='userInfo.avatar'></image>
|
|
||||||
<image src='../../../static/images/alter.png' class="alter"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class='item acea-row row-between-wrapper'>
|
|
||||||
<view>昵称</view>
|
|
||||||
<view class='input'><input type='text' name='nickname' :value='userInfo.nickname'></input></view>
|
|
||||||
</view>
|
|
||||||
<view class='item acea-row row-between-wrapper'>
|
|
||||||
<view>手机号码</view>
|
|
||||||
<navigator url="/pages/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone">
|
|
||||||
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</navigator>
|
|
||||||
<view class='input acea-row row-between-wrapper' v-else>
|
|
||||||
<input type='text' disabled='true' name='phone' :value='userInfo.phone' class='id'></input>
|
|
||||||
<text class='iconfont icon-suozi'></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class='item acea-row row-between-wrapper'>
|
|
||||||
<view>ID号</view>
|
|
||||||
<view class='input acea-row row-between-wrapper'>
|
|
||||||
<input type='text' :value='userInfo.uid' disabled='true' class='id'></input>
|
|
||||||
<text class='iconfont icon-suozi'></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- #ifdef MP -->
|
|
||||||
<view class='item acea-row row-between-wrapper'>
|
|
||||||
<view>权限设置</view>
|
|
||||||
<view class="input" @click="Setting">
|
|
||||||
点击管理<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone && userInfo.user_type == 'h5'">
|
|
||||||
<view>密码</view>
|
|
||||||
<navigator url="/pages/user_pwd_edit/index" hover-class="none" class="input">
|
|
||||||
点击修改密码<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</navigator>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
|
|
||||||
<!-- #ifdef H5 -->
|
|
||||||
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin" v-if="!this.$wechat.isWeixin()">退出登录</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
|
||||||
</form>
|
|
||||||
<!-- #ifdef MP -->
|
|
||||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getUserInfo,
|
|
||||||
userEdit,
|
|
||||||
getLogout
|
|
||||||
} from '@/api/user.js';
|
|
||||||
import {
|
|
||||||
switchH5Login
|
|
||||||
} from '@/api/api.js';
|
|
||||||
import {
|
|
||||||
toLogin
|
|
||||||
} from '@/libs/login.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
|
||||||
// #ifdef MP
|
|
||||||
import authorize from '@/components/Authorize';
|
|
||||||
// #endif
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
// #ifdef MP
|
|
||||||
authorize
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
userInfo: {},
|
|
||||||
loginType: 'h5', //app.globalData.loginType
|
|
||||||
userIndex: 0,
|
|
||||||
switchUserInfo: [],
|
|
||||||
isAuto: false, //没有授权的不会自动授权
|
|
||||||
isShowAuth: false //是否隐藏授权
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: mapGetters(['isLogin']),
|
|
||||||
onLoad() {
|
|
||||||
if (this.isLogin) {
|
|
||||||
this.getUserInfo();
|
|
||||||
} else {
|
|
||||||
// #ifdef H5 || APP-PLUS
|
|
||||||
toLogin();
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP
|
|
||||||
this.isAuto = true;
|
|
||||||
this.$set(this, 'isShowAuth', true)
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* 授权回调
|
|
||||||
*/
|
|
||||||
onLoadFun: function() {
|
|
||||||
this.getUserInfo();
|
|
||||||
},
|
|
||||||
// 授权关闭
|
|
||||||
authColse: function(e) {
|
|
||||||
this.isShowAuth = e
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 小程序设置
|
|
||||||
*/
|
|
||||||
Setting: function() {
|
|
||||||
uni.openSetting({
|
|
||||||
success: function(res) {
|
|
||||||
console.log(res.authSetting)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
switchAccounts: function(index) {
|
|
||||||
let userInfo = this.switchUserInfo[index],
|
|
||||||
that = this;
|
|
||||||
that.userIndex = index;
|
|
||||||
if (that.switchUserInfo.length <= 1) return true;
|
|
||||||
if (userInfo === undefined) return that.$util.Tips({
|
|
||||||
title: '切换的账号不存在'
|
|
||||||
});
|
|
||||||
if (userInfo.user_type === 'h5') {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '正在切换中'
|
|
||||||
});
|
|
||||||
switchH5Login().then(res => {
|
|
||||||
uni.hideLoading();
|
|
||||||
let newTime = Math.round(new Date() / 1000);
|
|
||||||
that.$store.commit("LOGIN", {
|
|
||||||
'token': res.data.token,
|
|
||||||
'time': dayjs(res.data.expires_time) - newTime
|
|
||||||
});
|
|
||||||
that.getUserInfo();
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
uni.hideLoading();
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
that.$store.commit("LOGOUT");
|
|
||||||
uni.showLoading({
|
|
||||||
title: '正在切换中'
|
|
||||||
});
|
|
||||||
// #ifdef H5 || APP-PLUS
|
|
||||||
toLogin();
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP
|
|
||||||
that.isAuto = true;
|
|
||||||
that.$set(that, 'isShowAuth', true);
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 退出登录
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
outLogin: function() {
|
|
||||||
let that = this;
|
|
||||||
if (that.loginType == 'h5') {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '确认退出登录?',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
getLogout()
|
|
||||||
.then(res => {
|
|
||||||
that.$store.commit("LOGOUT");
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
} else if (res.cancel) {
|
|
||||||
console.log('用户点击取消');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取用户详情
|
|
||||||
*/
|
|
||||||
getUserInfo: function() {
|
|
||||||
let that = this;
|
|
||||||
getUserInfo().then(res => {
|
|
||||||
that.$set(that, 'userInfo', res.data);
|
|
||||||
let switchUserInfo = res.data.switchUserInfo || [];
|
|
||||||
for (let i = 0; i < switchUserInfo.length; i++) {
|
|
||||||
if (switchUserInfo[i].uid == that.userInfo.uid) that.userIndex = i;
|
|
||||||
// 切割h5用户;user_type状态:h5、routine(小程序)、wechat(公众号);注:只有h5未注册手机号时,h5才可和小程序或是公众号数据想通;
|
|
||||||
//#ifdef H5
|
|
||||||
if (
|
|
||||||
!that.$wechat.isWeixin() &&
|
|
||||||
switchUserInfo[i].user_type != "h5" &&
|
|
||||||
switchUserInfo[i].phone === ""
|
|
||||||
)
|
|
||||||
switchUserInfo.splice(i, 1);
|
|
||||||
//#endif
|
|
||||||
}
|
|
||||||
that.$set(that, "switchUserInfo", switchUserInfo);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 上传文件
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
uploadpic: function() {
|
|
||||||
let that = this;
|
|
||||||
that.$util.uploadImageOne('upload/image', function(res){
|
|
||||||
console.log('mmj');
|
|
||||||
let userInfo = that.switchUserInfo[that.userIndex];
|
|
||||||
if (userInfo !== undefined) {
|
|
||||||
userInfo.avatar = res.data.url;
|
|
||||||
}
|
|
||||||
that.switchUserInfo[that.userIndex] = userInfo;
|
|
||||||
that.$set(that,'switchUserInfo',that.switchUserInfo);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交修改
|
|
||||||
*/
|
|
||||||
formSubmit: function(e) {
|
|
||||||
console.log(e);
|
|
||||||
let that = this,
|
|
||||||
value = e.detail.value,
|
|
||||||
userInfo = that.switchUserInfo[that.userIndex];
|
|
||||||
if (!value.nickname) return that.$util.Tips({
|
|
||||||
title: '用户姓名不能为空'
|
|
||||||
});
|
|
||||||
console.log('666666666666666666');
|
|
||||||
// value.avatar = userInfo.avatar;
|
|
||||||
userEdit(value).then(res => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'success'
|
|
||||||
}, {
|
|
||||||
tab: 3,
|
|
||||||
url: 1
|
|
||||||
});
|
|
||||||
}).catch(msg => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: msg || '保存失败,您并没有修改'
|
|
||||||
}, {
|
|
||||||
tab: 3,
|
|
||||||
url: 1
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.personal-data .wrapper {
|
|
||||||
margin: 10rpx 0;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 36rpx 30rpx 13rpx 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .title {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #282828;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item {
|
|
||||||
width: 690rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
margin-bottom: 22rpx;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
position: relative;
|
|
||||||
border: 2rpx solid #f8f8f8;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item.on {
|
|
||||||
border-color: #e93323;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAACgCAYAAADw+I85AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6M0QzNkY3NzlCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6M0QzNkY3N0FCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozRDM2Rjc3N0I3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozRDM2Rjc3OEI3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pn3rJMAAAArUSURBVHja7N3NXuLIGsDhqigK2Ou+grmEuf/t2fT+bOYKZn9aW5Q6qaQSIoKfoCQ8z29QRBSBzX+q31RiSikAAMDYVF4CAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUAQMgCAMAJuPQSAABMy79///XaXfJi5qy0YFUuqVzW9eWhvqzK9b1+/vpHyAIAcMjCqxs1tldj/zHl/6oU4rz+ctY2a3tzjO2n0F6tUqobMYZ5fX1V337XBm0MMbX3SuXnvv1peqcBAKYlXl+VSI2lZJuIzSuwi7pUY3/HFPsijYMPcVOps9hG7W19fRVT+50YT6TXvdUAABML2at5V6rdTdfNSmzXquX2FOKTr7trsVvBjeVOISzLyuyfNnNTOIWWFbIAAFNzfd2umjYrsmlWR+i8KuusXbhurudZgTZpU6w/p82Ka0oldJvb47z+cp3HDU5kQVbIAgBMTVwsmzitr1V1ni5C07Pd5EAXtCVlm3BNTfS27dvGbAiDcYPUr9TWvys91jetT2BEVsgCAEwuZOeLJkDr/+Z5sbXdb7UdCIixb9M2WDdjss2n4X274YN2LraJ3fzjeUTh9yk8TyELADC1kM0rsjHVTRpnTYam2I8LNBOuaRO0TbaWbQhidyRYKveLmz0P+vu223ZV8ZWtuYQsAADvD9nlTTMb23/dxelg9TUM4nSzRLvZsSANf274u9uvZnXm/hGyAAAcVHWzzKusl5uDtvq9YtvvpzZJmwGC+GS1tR83iHuGYMuPXtbfF7IAABxWXP7IyVkNT4awGQ/Y7FswHBkIW9e7W1Kfv0/GDKpTeJ5CFgBgapbLPAJQxX5X2DIuEPsdYtsSTak/nKv5Xir7GQxWZNvvlZGC/pReUcgCAHB41c2PnbfHrc+v3bbv61MhZAEAJibmkE1pXRdo9SRDuxXVuJWp3XBsGYDdfL9frx38jub767LVgZAFAOCAIdvsWpBjs5tlHZx4tvmQNhsVdH1bAjYO9pTtrlX9cEJvfQrPU8gCAExMdXOTPz3knQvCk/1iU4iDhO3HCuKT8yK0v6P/mfL9wTFf9W0PpzBvIGQBACYmLm7yOMCqDtB5f6hXak94UFo0lPMklO22ykFfg71mNyu3/ZkUNltz1b+7vYOQBQDgkCG7vMmxmWdkVyGfiWvH3rD9yWeb22O/KVdfuqVy29HZOBwuWKVmbEHIAgBw6JBdLMqKaryLMV3GwRFcqRykVXWt2g0V9KfyimV7rsEEbTkILLbDCXftqIGDvQAAOLTFsjtxwbrOzds6PJcpPT8pQnctlV6N/XlsBwd9lZXcsp/sbZXiuszJClkAAA4rzuclUpsl11UdoXcxxXm709Zg7rUp1fJ13KzKDnbfGhwQFu/qr1fdoGwUsgAAHD5kF32JlhD9E5ots+KiCv0JvAZzr3GzPUGJ235lNo8TpHjbBnF373QSz1PIAgBMLWSvrtoQTf3ga5YP0nqsP89jPgCs7dz2Q4xhu03T5mfuYnNyhTjYzSAE228BALDXv3//9aGf+/mf/5ai3Zy0q4wOrGOIv1NoznEwq0P3sv66yl+XLs0ztfV9wkOO2NieVKFP29SeKqyP2I/+fUIWAIDdZrP+6nDhdDMa0JyZ60+57LvPM9+0CJsfttq6NMetCVkAgIn57pXST0Zr7tOLEqzd552ELAAA3x2u3aV6zw8LWQAAvlKO1Vm5XHzmFwlZAABGE69CFgDgDb5z1vTnr3+m8BLmcL06VnMKWQCAwzRVt9rYHVWf5c2r8g4Bef/WVWi3tZq6WF6L6/DOmVchCwDwdcGWY+0q7N+ZKpa4vSj3y2F7H9ptr9IZvh5CFgDgm+UVx8UHgm0Ye7ehXaUVsEIWAOBLLEq0fTb+lqFdnb0d8WtxXS7fcq4EIQsA8HY5Pmc7bs9jAt0MbJ6HXZe460YLuhna7eDrVjF/j+x1yM9lHo48AytkAQAOY7EnYu9Cu7KadsRtd7DXqtzvqgTgdhTm3z2Gldmq/K0n0ZBCFgDgdd02UkM5UPNK6uMbf0eO2nyQV161XYanq5lX5fZTnpn91jGCfVUNAMB+OdwWOyL2f++I2KHH8rPrrds/cvDYV/XiTWhXkuOp/WEAAOy3axXy944QfY9uNXc7mK9P7Lnnlegf4UT/FV/IAgC8bHukII8HPB7g9z6W3/XSY32nvEK8DKe5SixkAQBecbkVcmlHfH7G9okRYvj+1c/chz9OLKqFLADAO23vUrAKhz0jV7dt10uP+dXhniP2YgxvjpAFANhvO+gejvAYD6885lfJK7D5oK44ljfH9lsAAPttL/o9HuExHl95zK+QdyS4HtubI2QBAPbbXp1cH+Ex1q885rEd4pS7J/F/GQAAvD1sx260EStkAQBelr4gZKtXHvNYlmOOWCELAPCy7X/2P8aBWBevPOYx5JXY2djfHCELALDf9oFYxzi+6PKVxzxGxF5N4c0RsgAA++3a4/WQ4wUxPF8ZfTji85lPJWKFLADAy3JUbp9565DbVF2H52cOWx3puczCCLfYErIAAB93vyM+DzEre7EjLO+P9Bzy+MJyam+MkAUAeNmf8HwngeUnO6raEZapPNYxem85xTdGyAIAvCwH5u2Ohsqnc/3IyuxF+dntDrsNh996K5aIjVN8Y4QsAMDr8tzq/Y6O+hHaA6jeEoqx3PfHjga7D8eZjZ2H42wZdhKcohYA4G1uw+5dBvKc61UJ0XxZh81esFW5zML+HQ9W4fmK7yHMwoR2KBCyAACf8zvs3oc1ltveG473R4rYqvydkyZkAQDeJ4fnQwnFj86ednO3x9pq6zN/m5AFAJiwVYnZbqzgrdGYAzavwu7aCeFQrs6l8YQsAMDH5BC9K5fcVHkmNR9YVQ3CNt8nz8s+DuL3mPJjz8/lDRCyAACf9/AFkfoWZzFSIGQBAF7x89c/Y/pzZ+fWdvaRBQCYhvm5PWEhCwAwftfn2HVCFgBg3GIJ2bMjZAEAxu06nNEBXkIWAGAaujOKnSUhCwAwXme7GitkAQDG66xXY2tJyAIAjNMsnPFqbG0tZAEAxun6zJ+/kAUAGKF8Bq9z77hHIQsAMD5XXoLwIGQBAMYlz8XOzvw1WAcrsgAAo2M1NoRV/iBkAQDGZeYlCPdCFgBgXHK7XYjYZrRAyAIAjMi5r8am+nI3rHoAAITsGNyWmBWyAAAjkncrOOexgjxSsBreIGQBAMbh8oyfew7Y2+0bhSwAgJA9ZQ+7Ivbcyx4AQMietvt9EStkAQDGIc/HntO/pKcSsCtlDwAwbufUbHkV9i4MdifwogAAjNfUdyvIJzhYhcHJDtQ9AMA0TGmsIJVYzZfH0B7M9fiRX/R/AQYA1i4UF+HkevkAAAAASUVORK5CYII=");
|
|
||||||
background-size: 100% 100%;
|
|
||||||
background-color: #fff9f9;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt {
|
|
||||||
width: 445rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue {
|
|
||||||
width: 96rpx;
|
|
||||||
height: 96rpx;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .pictrue .alter {
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .text {
|
|
||||||
width: 325rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .text .name {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #282828;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .picTxt .text .phone {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .bnt {
|
|
||||||
font-size: 24rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 27rpx;
|
|
||||||
width: 140rpx;
|
|
||||||
height: 54rpx;
|
|
||||||
border: 2rpx solid #e93323;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .wrapper .wrapList .item .currentBnt {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
font-size: 26rpx;
|
|
||||||
background-color: rgba(233, 51, 35, 0.1);
|
|
||||||
width: 140rpx;
|
|
||||||
height: 48rpx;
|
|
||||||
border-radius: 0 20rpx 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list {
|
|
||||||
margin-top: 15rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item {
|
|
||||||
padding: 30rpx 30rpx 30rpx 0;
|
|
||||||
border-bottom: 1rpx solid #f2f2f2;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #282828;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .phone {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 56rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #fff;
|
|
||||||
line-height: 56rpx;
|
|
||||||
border-radius: 32rpx
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .pictrue {
|
|
||||||
width: 88rpx;
|
|
||||||
height: 88rpx;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .pictrue image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .pictrue .alter{
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .input {
|
|
||||||
width: 415rpx;
|
|
||||||
text-align: right;
|
|
||||||
color: #868686;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .input .id {
|
|
||||||
width: 365rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .list .item .input .iconfont {
|
|
||||||
font-size: 35rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .modifyBnt {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #fff;
|
|
||||||
width: 690rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 90rpx;
|
|
||||||
margin: 76rpx auto 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.personal-data .logOut {
|
|
||||||
font-size: 32rpx;
|
|
||||||
text-align: center;
|
|
||||||
width: 690rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
border-radius: 45rpx;
|
|
||||||
margin: 30rpx auto 0 auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -12,16 +12,15 @@
|
||||||
<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item}}</view>
|
<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='tip picList' v-if='!active'>
|
<view class='tip picList' v-if='!active'>
|
||||||
<view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic == index ? 'pic-box-color-active' : ''"
|
<view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic === index ? 'pic-box-color-active' : ''"
|
||||||
v-for="(item, index) in picList" :key="index" @click="picCharge(index, item)">
|
v-for="(item, index) in picList" :key="index" @click="picCharge(index, item)">
|
||||||
<view class="pic-number-pic">
|
<view class="pic-number-pic">
|
||||||
{{ item.price }}<span class="pic-number"> 元</span>
|
{{ item.price }}<span class="pic-number"> 元</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="pic-number">赠送:{{ item.giveMoney }} 元</view>
|
<view class="pic-number">赠送:{{ item.giveMoney }} 元</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="activePic == picList.length ? 'pic-box-color-active' : ''"
|
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''" @click="picCharge(picList.length)">
|
||||||
@click="picCharge(picList.length)">
|
<input type="number" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
|
||||||
<input type="number" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic" :class="activePic == picList.length ? 'pic-box-color-active' : ''" />
|
|
||||||
</view>
|
</view>
|
||||||
<view class="tips-box">
|
<view class="tips-box">
|
||||||
<view class="tips mt-30">注意事项:</view>
|
<view class="tips mt-30">注意事项:</view>
|
||||||
|
@ -485,12 +484,11 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.pic-box-color-active {
|
.pic-box-color-active {
|
||||||
background-color: #ec3323 !important;
|
background-color: #ec3323 !important;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.tips-box {
|
.tips-box {
|
||||||
.tips {
|
.tips {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
|
@ -124,8 +124,6 @@
|
||||||
let loadend = list.length < that.limit;
|
let loadend = list.length < that.limit;
|
||||||
that.orderList = that.$util.SplitArray(list, that.orderList);
|
that.orderList = that.$util.SplitArray(list, that.orderList);
|
||||||
that.$set(that,'orderList',that.orderList);
|
that.$set(that,'orderList',that.orderList);
|
||||||
console.log('8888888888888888888');
|
|
||||||
console.log(that.orderList);
|
|
||||||
that.loadend = loadend;
|
that.loadend = loadend;
|
||||||
that.loading = false;
|
that.loading = false;
|
||||||
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
|
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view style="height: 100%;">
|
||||||
<view class='distribution-posters'>
|
<view class='distribution-posters'>
|
||||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
||||||
@change="bindchange" previous-margin="40px" next-margin="40px">
|
@change="bindchange" previous-margin="40px" next-margin="40px">
|
||||||
|
@ -23,9 +23,9 @@
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="canvas">
|
<view class="canvas" v-if="canvasStatus">
|
||||||
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
|
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
|
||||||
<canvas style="" canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
|
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -76,11 +76,10 @@
|
||||||
poster: '',
|
poster: '',
|
||||||
isAuto: false, //没有授权的不会自动授权
|
isAuto: false, //没有授权的不会自动授权
|
||||||
isShowAuth: false, //是否隐藏授权
|
isShowAuth: false, //是否隐藏授权
|
||||||
imagePath: '',
|
|
||||||
qrcodeSize: 1000,
|
qrcodeSize: 1000,
|
||||||
PromotionCode: '',
|
PromotionCode: '',
|
||||||
base64List: [],
|
base64List: [],
|
||||||
posterbackgd: 'https://image.java.crmeb.net/image/product/2020/08/03/755bf516b1ca4b6db3bfeaa4dd5901cdh71kob20re.jpg'
|
canvasStatus: true //海报绘图标签
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: mapGetters(['isLogin']),
|
computed: mapGetters(['isLogin']),
|
||||||
|
@ -143,7 +142,6 @@
|
||||||
imageBase64({url:item.pic}).then(res=>{
|
imageBase64({url:item.pic}).then(res=>{
|
||||||
spreadList[index] = res.data.code;
|
spreadList[index] = res.data.code;
|
||||||
that.$set(that,'base64List',spreadList);
|
that.$set(that,'base64List',spreadList);
|
||||||
//that.$set(that, 'poster', spreadList[0]);
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -153,7 +151,6 @@
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
that.userInfos();
|
that.userInfos();
|
||||||
console.log('上',this.base64List)
|
|
||||||
},
|
},
|
||||||
// 小程序二维码
|
// 小程序二维码
|
||||||
getQrcode(){
|
getQrcode(){
|
||||||
|
@ -164,7 +161,7 @@
|
||||||
}
|
}
|
||||||
let arrImagesUrl = "";
|
let arrImagesUrl = "";
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: this.base64List[0], //仅为示例,并非真实的资源
|
url: this.base64List[0],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
arrImagesUrl = res.tempFilePath;
|
arrImagesUrl = res.tempFilePath;
|
||||||
}
|
}
|
||||||
|
@ -172,12 +169,18 @@
|
||||||
getQrcode(data).then(res=>{
|
getQrcode(data).then(res=>{
|
||||||
base64src(res.data.code, res => {
|
base64src(res.data.code, res => {
|
||||||
that.PromotionCode = res;
|
that.PromotionCode = res;
|
||||||
console.log('第一张',that.PromotionCode)
|
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
|
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
|
||||||
}, 200);
|
}, 300);
|
||||||
})
|
}).catch(err => {
|
||||||
|
uni.hideLoading();
|
||||||
|
that.$util.Tips({
|
||||||
|
title: err
|
||||||
|
});
|
||||||
|
that.$set(that, 'canvasStatus', false);
|
||||||
|
//that.getQrcode();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 生成二维码;
|
// 生成二维码;
|
||||||
make() {
|
make() {
|
||||||
|
@ -190,10 +193,14 @@
|
||||||
margin: 10,
|
margin: 10,
|
||||||
success: res => {
|
success: res => {
|
||||||
that.PromotionCode = res;
|
that.PromotionCode = res;
|
||||||
|
setTimeout(() => {
|
||||||
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
|
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
complete: (res) => {
|
||||||
},
|
},
|
||||||
complete: () => {},
|
|
||||||
fail: res => {
|
fail: res => {
|
||||||
|
uni.hideLoading();
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: '海报二维码生成失败!'
|
title: '海报二维码生成失败!'
|
||||||
});
|
});
|
||||||
|
@ -222,35 +229,17 @@
|
||||||
canvasId: 'canvasOne',
|
canvasId: 'canvasOne',
|
||||||
fileType: 'jpg',
|
fileType: 'jpg',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log("成功",res)
|
|
||||||
// 在H5平台下,tempFilePath 为 base64
|
// 在H5平台下,tempFilePath 为 base64
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.imagePath = res.tempFilePath;
|
|
||||||
that.spreadList[index].pic = res.tempFilePath;
|
that.spreadList[index].pic = res.tempFilePath;
|
||||||
that.poster = res.tempFilePath;
|
that.$set(that, 'poster', res.tempFilePath);
|
||||||
console.log("spreadList = ", that.spreadList[index].pic)
|
that.$set(that, 'canvasStatus', false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}, 100);
|
}, 100);
|
||||||
// context.draw(true,function(){
|
|
||||||
// uni.canvasToTempFilePath({
|
|
||||||
// destWidth: 750,
|
|
||||||
// destHeight: 1190,
|
|
||||||
// canvasId: 'canvasOne',
|
|
||||||
// fileType: 'jpg',
|
|
||||||
// success: function(res) {
|
|
||||||
// console.log("成功",res)
|
|
||||||
// // 在H5平台下,tempFilePath 为 base64
|
|
||||||
// uni.hideLoading();
|
|
||||||
// that.imagePath = res.tempFilePath;
|
|
||||||
// that.spreadList[index].pic = res.tempFilePath;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
console.log("失败",err)
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: '无法获取图片信息'
|
title: '无法获取图片信息'
|
||||||
|
@ -274,25 +263,19 @@
|
||||||
this.swiperIndex = index;
|
this.swiperIndex = index;
|
||||||
let arrImagesUrl = "";
|
let arrImagesUrl = "";
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: base64List[index], //仅为示例,并非真实的资源
|
url: base64List[index],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log('移动',res)
|
|
||||||
arrImagesUrl = res.tempFilePath;
|
arrImagesUrl = res.tempFilePath;
|
||||||
console.log('移动图片',arrImagesUrl)
|
|
||||||
console.log('移动二维码',this.PromotionCode)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.$set(this, 'canvasStatus', true);
|
||||||
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname, index);
|
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname, index);
|
||||||
}, 200);
|
}, 300);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 点击保存海报
|
// 点击保存海报
|
||||||
savePosterPath: function() {
|
savePosterPath: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.downloadFile({
|
|
||||||
url: that.poster,
|
|
||||||
success(resFile) {
|
|
||||||
if (resFile.statusCode === 200) {
|
|
||||||
uni.getSetting({
|
uni.getSetting({
|
||||||
success(res) {
|
success(res) {
|
||||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
@ -300,73 +283,39 @@
|
||||||
scope: 'scope.writePhotosAlbum',
|
scope: 'scope.writePhotosAlbum',
|
||||||
success() {
|
success() {
|
||||||
uni.saveImageToPhotosAlbum({
|
uni.saveImageToPhotosAlbum({
|
||||||
filePath: resFile.tempFilePath,
|
filePath: that.poster,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
return that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: '保存成功'
|
title: '保存成功',
|
||||||
|
icon: 'success'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function(res) {
|
fail: function(res) {
|
||||||
return that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: res
|
title: '保存失败'
|
||||||
});
|
|
||||||
},
|
|
||||||
complete: function(res) {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail() {
|
|
||||||
uni.showModal({
|
|
||||||
title: '您已拒绝获取相册权限',
|
|
||||||
content: '是否进入权限管理,调整授权?',
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
uni.openSetting({
|
|
||||||
success: function(res) {
|
|
||||||
console.log(res.authSetting)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (res.cancel) {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: '已取消!'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
uni.saveImageToPhotosAlbum({
|
uni.saveImageToPhotosAlbum({
|
||||||
filePath: resFile.tempFilePath,
|
filePath: that.poster,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
return that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: '保存成功'
|
title: '保存成功',
|
||||||
|
icon: 'success'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function(res) {
|
fail: function(res) {
|
||||||
return that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: res
|
title: '保存失败'
|
||||||
});
|
|
||||||
},
|
|
||||||
complete: function(res) {},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail(res) {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: resFile
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
fail(res) {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: res
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
userInfos() {
|
userInfos() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -399,11 +348,18 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #a3a3a3 !important;
|
background-color: #a3a3a3 !important;
|
||||||
|
height: 100% !important;
|
||||||
}
|
}
|
||||||
.canvas{
|
.canvas{
|
||||||
position: fixed;
|
position: relative;
|
||||||
z-index: -5rpx;
|
}
|
||||||
opacity: 0;
|
.distribution-posters{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
.distribution-posters swiper {
|
.distribution-posters swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -192,11 +192,12 @@
|
||||||
page {
|
page {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
color: #333
|
color: #333;
|
||||||
|
/* height: 100%; */
|
||||||
}
|
}
|
||||||
|
|
||||||
body,html {
|
body,html {
|
||||||
height: unset
|
/* height: unset */
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
const fsm = wx.getFileSystemManager();
|
const fsm = uni.getFileSystemManager ? uni.getFileSystemManager() : null;
|
||||||
const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
|
const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
|
||||||
|
|
||||||
export function base64src(base64data, cb) {
|
export function base64src(base64data, cb) {
|
||||||
|
|
251
utils/util.js
251
utils/util.js
|
@ -157,157 +157,124 @@ import {
|
||||||
arr.push(text.slice(str, text.length));
|
arr.push(text.slice(str, text.length));
|
||||||
return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数]
|
return [strLength, arr, rows] // [处理文字的总字节长度,每行显示内容的数组,行数]
|
||||||
},
|
},
|
||||||
// 生成海报
|
|
||||||
PosterCanvas:function(arrImages, storeName, price, successFn){
|
|
||||||
uni.showLoading({
|
|
||||||
title: '海报生成中',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
let context = uni.createCanvasContext('firstCanvas')
|
|
||||||
context.clearRect(0, 0, 0, 0);
|
|
||||||
let that = this;
|
|
||||||
uni.getImageInfo({
|
|
||||||
src: arrImages[0],
|
|
||||||
success: function (image) {
|
|
||||||
console.log('image成功', image)
|
|
||||||
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
|
||||||
context.drawImage(arrImages[1], 0, 0, 750, 750);
|
|
||||||
context.save();
|
|
||||||
context.drawImage(arrImages[2], 110, 1000, 140, 140);
|
|
||||||
context.restore();
|
|
||||||
context.setFontSize(30);
|
|
||||||
context.setTextAlign('center');
|
|
||||||
let maxText = 28;
|
|
||||||
let text = storeName;
|
|
||||||
let topText = '';
|
|
||||||
let bottomText = '';
|
|
||||||
let len = text.length;
|
|
||||||
if(len>maxText*2){
|
|
||||||
text = text.slice(0,maxText*2-4)+'......';
|
|
||||||
topText = text.slice(0,maxText-1);
|
|
||||||
bottomText = text.slice(maxText-1,len);
|
|
||||||
}else{
|
|
||||||
if(len>maxText){
|
|
||||||
topText = text.slice(0,maxText-1);
|
|
||||||
bottomText = text.slice(maxText-1,len);
|
|
||||||
}else{
|
|
||||||
topText = text;
|
|
||||||
bottomText = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
context.fillText(topText, 750/2, 800);
|
|
||||||
context.fillText(bottomText, 750/2, 840);
|
|
||||||
context.setFontSize(37);
|
|
||||||
context.setTextAlign('center');
|
|
||||||
context.setFillStyle('#fc4141');
|
|
||||||
context.fillText('¥' + price, 750 / 2, 900);
|
|
||||||
context.draw(true,function(){
|
|
||||||
uni.canvasToTempFilePath({
|
|
||||||
destWidth: 750,
|
|
||||||
destHeight: 1190,
|
|
||||||
canvasId: 'firstCanvas',
|
|
||||||
fileType: 'jpg',
|
|
||||||
success: function(res) {
|
|
||||||
console.log(res.tempFilePath)
|
|
||||||
// 在H5平台下,tempFilePath 为 base64
|
|
||||||
uni.hideLoading();
|
|
||||||
successFn && successFn(res.tempFilePath);
|
|
||||||
// that.imagePath = res.tempFilePath;
|
|
||||||
// that.canvasStatus = true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: function(err) {
|
|
||||||
console.log('image失败', err)
|
|
||||||
uni.hideLoading();
|
|
||||||
that.Tips({
|
|
||||||
title: '无法获取图片信息'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 获取分享海报
|
* 获取分享海报
|
||||||
* @param array arr2 海报素材
|
* @param array arr2 海报素材
|
||||||
* @param string store_name 素材文字
|
* @param string store_name 素材文字
|
||||||
* @param string price 价格
|
* @param string price 价格
|
||||||
|
* @param string ot_price 原始价格
|
||||||
* @param function successFn 回调函数
|
* @param function successFn 回调函数
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// PosterCanvas: function(arr2, store_name, price, successFn) {
|
PosterCanvas: function(arr2, store_name, price,ot_price, successFn) {
|
||||||
// let that = this;
|
let that = this;
|
||||||
// uni.showLoading({
|
uni.showLoading({
|
||||||
// title: '海报生成中',
|
title: '海报生成中',
|
||||||
// mask: true
|
mask: true
|
||||||
// });
|
});
|
||||||
// const ctx = uni.createCanvasContext('myCanvas');
|
const ctx = uni.createCanvasContext('firstCanvas');
|
||||||
// ctx.clearRect(0, 0, 0, 0);
|
ctx.clearRect(0, 0, 0, 0);
|
||||||
// /**
|
/**
|
||||||
// * 只能获取合法域名下的图片信息,本地调试无法获取
|
* 只能获取合法域名下的图片信息,本地调试无法获取
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// uni.getImageInfo({
|
ctx.fillStyle = '#fff';
|
||||||
// src: arr2[0],
|
ctx.fillRect(0, 0, 750, 1150);
|
||||||
// success: function(res) {
|
uni.getImageInfo({
|
||||||
// const WIDTH = res.width;
|
src: arr2[0],
|
||||||
// const HEIGHT = res.height;
|
success: function(res) {
|
||||||
// ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
|
const WIDTH = res.width;
|
||||||
// ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
|
const HEIGHT = res.height;
|
||||||
// ctx.save();
|
// ctx.drawImage(arr2[0], 0, 0, WIDTH, 1050);
|
||||||
// let r = 90;
|
ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
|
||||||
// let d = r * 2;
|
ctx.save();
|
||||||
// let cx = 40;
|
let r = 110;
|
||||||
// let cy = 990;
|
let d = r * 2;
|
||||||
// ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
|
let cx = 480;
|
||||||
// ctx.drawImage(arr2[2], cx, cy,d,d);
|
let cy = 790;
|
||||||
// ctx.restore();
|
ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
|
||||||
// const CONTENT_ROW_LENGTH = 40;
|
// ctx.clip();
|
||||||
// let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH);
|
ctx.drawImage(arr2[2], cx, cy,d,d);
|
||||||
// if (contentRows > 2) {
|
ctx.restore();
|
||||||
// contentRows = 2;
|
const CONTENT_ROW_LENGTH = 20;
|
||||||
// let textArray = contentArray.slice(0, 2);
|
let [contentLeng, contentArray, contentRows] = that.textByteLength(store_name, CONTENT_ROW_LENGTH);
|
||||||
// textArray[textArray.length - 1] += '……';
|
if (contentRows > 2) {
|
||||||
// contentArray = textArray;
|
contentRows = 2;
|
||||||
// }
|
let textArray = contentArray.slice(0, 2);
|
||||||
// ctx.setTextAlign('center');
|
textArray[textArray.length - 1] += '……';
|
||||||
// ctx.setFontSize(32);
|
contentArray = textArray;
|
||||||
// let contentHh = 32 * 1.3;
|
}
|
||||||
// for (let m = 0; m < contentArray.length; m++) {
|
ctx.setTextAlign('left');
|
||||||
// ctx.fillText(contentArray[m], WIDTH / 2, 820 + contentHh * m);
|
ctx.setFontSize(36);
|
||||||
// }
|
ctx.setFillStyle('#000');
|
||||||
// ctx.setTextAlign('center')
|
// let contentHh = 36 * 1.5;
|
||||||
// ctx.setFontSize(48);
|
let contentHh = 36;
|
||||||
// ctx.setFillStyle('red');
|
for (let m = 0; m < contentArray.length; m++) {
|
||||||
// ctx.fillText('¥' + price, WIDTH / 2, 880 + contentHh);
|
// ctx.fillText(contentArray[m], 50, 1000 + contentHh * m,750);
|
||||||
// console.log('787878奋斗奋斗');
|
if (m) {
|
||||||
// console.log(res);
|
ctx.fillText(contentArray[m], 50, 1000 + contentHh * m + 18,1100);
|
||||||
// ctx.draw(true, function() {
|
} else {
|
||||||
// console.log('我在测试');
|
ctx.fillText(contentArray[m], 50, 1000 + contentHh * m,1100);
|
||||||
// console.log(res);
|
}
|
||||||
// uni.canvasToTempFilePath({
|
}
|
||||||
// canvasId: 'myCanvas',
|
ctx.setTextAlign('left')
|
||||||
// fileType: 'png',
|
ctx.setFontSize(72);
|
||||||
// destWidth: WIDTH,
|
ctx.setFillStyle('#DA4F2A');
|
||||||
// destHeight: HEIGHT,
|
ctx.fillText('¥' + price, 40, 820 + contentHh);
|
||||||
// success: function(res) {
|
|
||||||
// console.log('3333');
|
ctx.setTextAlign('left')
|
||||||
// console.log(res);
|
ctx.setFontSize(36);
|
||||||
// uni.hideLoading();
|
ctx.setFillStyle('#999');
|
||||||
// successFn && successFn(res.tempFilePath);
|
ctx.fillText('¥' + ot_price, 50, 876 + contentHh);
|
||||||
// }
|
|
||||||
// })
|
var underline = function(ctx, text, x, y, size, color, thickness ,offset){
|
||||||
// });
|
var width = ctx.measureText(text).width;
|
||||||
// },
|
switch(ctx.textAlign){
|
||||||
// fail: function(err) {
|
case "center":
|
||||||
// uni.hideLoading();
|
x -= (width/2); break;
|
||||||
// that.Tips({
|
case "right":
|
||||||
// title: '无法获取图片信息'
|
x -= width; break;
|
||||||
// });
|
}
|
||||||
// }
|
|
||||||
// })
|
y += size+offset;
|
||||||
// },
|
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.strokeStyle = color;
|
||||||
|
ctx.lineWidth = thickness;
|
||||||
|
ctx.moveTo(x,y);
|
||||||
|
ctx.lineTo(x+width,y);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
underline(ctx,'¥'+ot_price, 55,865,36,'#999',2,0)
|
||||||
|
ctx.setTextAlign('left')
|
||||||
|
ctx.setFontSize(28);
|
||||||
|
ctx.setFillStyle('#999');
|
||||||
|
ctx.fillText('长按或扫描查看', 490, 1030 + contentHh);
|
||||||
|
ctx.draw(true, function() {
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'firstCanvas',
|
||||||
|
fileType: 'png',
|
||||||
|
destWidth: WIDTH,
|
||||||
|
destHeight: HEIGHT,
|
||||||
|
success: function(res) {
|
||||||
|
uni.hideLoading();
|
||||||
|
successFn && successFn(res.tempFilePath);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log('失败',err)
|
||||||
|
uni.hideLoading();
|
||||||
|
that.Tips({
|
||||||
|
title: '无法获取图片信息'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 单图上传
|
* 单图上传
|
||||||
* @param object opt
|
* @param object opt
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
productionSourceMap: true, // 生产打包时不输出map文件,增加打包速度
|
productionSourceMap: true, // 生产打包时不输出map文件,增加打包速度
|
||||||
configureWebpack: config => {
|
configureWebpack: config => {
|
||||||
if (process.env.NODE_ENV === 'production') {
|
// if (process.env.NODE_ENV === 'production') {
|
||||||
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
|
// config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
|
||||||
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
|
// config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
|
||||||
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
|
// config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
|
||||||
config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
|
// config.optimization.minimizer[0].options.terserOptions.compress.pure_funcs = ['console.log']
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue