修复内容
1. 会员等级背景图去掉校验 2. 当查询不到会员等级是,按无会员等级展示 3. 删除商城首页冗余配置在index中的引用 4. 换绑推广人时,计算上一个推广人的推广人数 5. pc后台清除推广人时,更新推广人数量 6. 保证砍价金额最小为0.01 7. 修复商品删除时购物车关联删除 8. 删除商品问题修复 9. 运费模板——指定包邮,包邮数量类型修改 10. 签到错误修复 11. 修复我的优惠券只查询20条的问题 12. 文章列表修复 13. 拼团商品详情页数据统计显示问题修复 14. PC后台,账户详情,持有优惠券列表修复 15. 支付查询参数修复 16. 修复过期优惠券可以重复领取 17. 订单邮费切换地址重复计算修复 18. 判断是否在指定包邮区域内 必须满足件数 + 金额 才能包邮 19. 支付页面,切换tab,金额计算问题修复 20. 物流模板新增、编辑——修复 21. 去除线下邮费的影响 22. 订单运费计算重写 23. 下单页面到店自提合计金额不应该计算商品邮费 24. 新人券领取后,部分使用时间为空——修复pull/1/MERGE
|
@ -0,0 +1,24 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
build.sh
|
||||
.idea
|
||||
unpackage
|
|
@ -0,0 +1,11 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"type": "uniCloud",
|
||||
"default": {
|
||||
"launchtype": "remote"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
108
App.vue
|
@ -1,13 +1,8 @@
|
|||
<!-- <template>
|
||||
<view>
|
||||
<iframe ref="geoPage" width="0" height="0" frameborder="0" style="display:none;"
|
||||
scrolling="no" src="https://java.crmeb.net">
|
||||
</iframe>
|
||||
</view>
|
||||
</template> -->
|
||||
<script>
|
||||
import { checkLogin } from "./libs/login";
|
||||
import { HTTP_REQUEST_URL } from './config/app';
|
||||
import Auth from './libs/wechat.js';
|
||||
import Routine from './libs/routine.js';
|
||||
|
||||
export default {
|
||||
globalData: {
|
||||
|
@ -28,16 +23,16 @@
|
|||
switch (option.scene) {
|
||||
//扫描小程序码
|
||||
case 1047:
|
||||
let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
|
||||
that.globalData.code = val.pid;
|
||||
// let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene));
|
||||
that.globalData.spid = option.query.scene;
|
||||
break;
|
||||
//长按图片识别小程序码
|
||||
case 1048:
|
||||
that.globalData.code = option.query.scene;
|
||||
that.globalData.spid = option.query.scene;
|
||||
break;
|
||||
//手机相册选取小程序码
|
||||
case 1049:
|
||||
that.globalData.code = option.query.scene;
|
||||
that.globalData.spid = option.query.scene;
|
||||
break;
|
||||
//直接进入小程序
|
||||
case 1001:
|
||||
|
@ -52,9 +47,100 @@
|
|||
that.globalData.navHeight = res.statusBarHeight * (750 / res.windowWidth) + 91;
|
||||
}
|
||||
});
|
||||
|
||||
// #ifdef H5
|
||||
let snsapiBase = 'snsapi_base';
|
||||
let urlData = location.pathname + location.search;
|
||||
if (!that.$store.getters.isLogin && Auth.isWeixin()) {
|
||||
const { code, state, scope } = option.query;
|
||||
if (code && location.pathname.indexOf('/pages/users/wechat_login/index') === -1) {
|
||||
// 存储静默授权code
|
||||
uni.setStorageSync('snsapiCode', code);
|
||||
let spread = that.globalData.spid ? that.globalData.spid : 0;
|
||||
Auth.auth(code, that.$Cache.get('spread'))
|
||||
.then(res => {
|
||||
uni.setStorageSync('snRouter', decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||
if (res.type === 'register') {
|
||||
this.$Cache.set('snsapiKey', res.key);
|
||||
}
|
||||
if(res.type === 'login'){
|
||||
// let time = res.data.expires_time - this.$Cache.time();
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.token,
|
||||
// time: time
|
||||
});
|
||||
// this.$store.commit('SETUID', res.data.userInfo.uid);
|
||||
// this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
|
||||
//location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$util.Tips({
|
||||
title: error
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (!this.$Cache.has('snsapiKey')) {
|
||||
console.log('app.vue页面中',location.pathname.indexOf('/pages/users/wechat_login/index') === -1)
|
||||
//Auth.oAuth(snsapiBase, urlData);
|
||||
if (location.pathname.indexOf('/pages/users/wechat_login/index') === -1) {
|
||||
Auth.oAuth(snsapiBase, urlData);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (option.query.back_url) {
|
||||
location.replace(uni.getStorageSync('snRouter'));
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
// 小程序静默授权
|
||||
if (!this.$store.getters.isLogin) {
|
||||
let spread = that.globalData.spid ? that.globalData.spid : 0;
|
||||
Routine.getCode()
|
||||
.then(code => {
|
||||
Routine.authUserInfo(code,{'spread_spid': spread}).then(res => {
|
||||
that.$store.commit('AuthorizeType', res.data.type);
|
||||
})
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 小程序静默授权
|
||||
silenceAuth(code) {
|
||||
let that = this;
|
||||
let spread = that.globalData.spid ? that.globalData.spid : 0;
|
||||
silenceAuth({
|
||||
code: code,
|
||||
spread_spid: spread,
|
||||
spread_code: that.globalData.code
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.token !== undefined && res.data.token) {
|
||||
uni.hideLoading();
|
||||
let time = res.data.expires_time - this.$Cache.time();
|
||||
that.$store.commit('LOGIN', {
|
||||
token: res.data.token,
|
||||
time: time
|
||||
});
|
||||
that.$store.commit('SETUID', res.data.userInfo.uid);
|
||||
that.$store.commit('UPDATE_USERINFO', res.data.userInfo);
|
||||
}
|
||||
})
|
||||
.catch(res => {
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
// #ifdef H5
|
||||
uni.getSystemInfo({
|
||||
|
|
12
api/api.js
|
@ -171,11 +171,19 @@ export function switchH5Login() {
|
|||
// #endif
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
* 换绑手机号
|
||||
*
|
||||
*/
|
||||
export function bindingPhone(data){
|
||||
return request.post('binding',data);
|
||||
return request.post('update/binding',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 换绑手机号校验
|
||||
*
|
||||
*/
|
||||
export function bindingVerify(data){
|
||||
return request.post('update/binding/verify',data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import request from "@/utils/request.js";
|
||||
import wechat from "@/libs/wechat.js";
|
||||
|
||||
import {
|
||||
toLogin,
|
||||
checkLogin
|
||||
} from '../libs/login';
|
||||
/**
|
||||
* 获取微信公众号js配置
|
||||
* @returns {*}
|
||||
|
@ -85,3 +88,24 @@ export function copyWords() {
|
|||
export function kefuConfig() {
|
||||
return request.get("config", {}, { noAuth: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信(公众号,小程序)绑定手机号
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function getUserPhone(data){
|
||||
return request.post('wechat/register/binding/phone',data,{noAuth : true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 静默授权
|
||||
* @param {Object} data
|
||||
*/
|
||||
export function silenceAuth(data) {
|
||||
//#ifdef MP
|
||||
return request.get("wechat/authorize/program/login", data, { noAuth : true });
|
||||
//#endif
|
||||
//#ifdef H5
|
||||
return request.get("wechat/authorize/login", data, { noAuth : true });
|
||||
//#endif
|
||||
}
|
|
@ -365,7 +365,7 @@ export function getChatRecord(to_uid, data) {
|
|||
*/
|
||||
export function spread(puid)
|
||||
{
|
||||
return request.post("user/spread",{puid:puid});
|
||||
return request.get("user/bindSpread?spreadPid=" + puid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
return;
|
||||
}
|
||||
getLogo().then(res=>{
|
||||
that.logoUrl = res.data.logo_url
|
||||
that.logoUrl = res.data.logoUrl
|
||||
Cache.set(LOGO_URL,that.logoUrl);
|
||||
})
|
||||
},
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<text class="red" v-if="tipText">{{ tipText }}</text>
|
||||
<text class="styleAll" v-if="isDay === true">{{ day }}</text>
|
||||
<text class="timeTxt red" v-if="dayText">{{ dayText }}</text>
|
||||
<text class="styleAll">{{ hour }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""'>{{ hour }}</text>
|
||||
<text class="timeTxt red" v-if="hourText">{{ hourText }}</text>
|
||||
<text class="styleAll">{{ minute }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""'>{{ minute }}</text>
|
||||
<text class="timeTxt red" v-if="minuteText">{{ minuteText }}</text>
|
||||
<text class="styleAll">{{ second }}</text>
|
||||
<text class="styleAll" :class='isCol?"timeCol":""'>{{ second }}</text>
|
||||
<text class="timeTxt red" v-if="secondText">{{ secondText }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
@ -48,6 +48,10 @@
|
|||
isDay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
isCol: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
|
@ -113,8 +117,20 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #fc4141;
|
||||
margin: 0 4rpx;
|
||||
}
|
||||
|
||||
.timeCol {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align:center;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
color: #E93323;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<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.id)" :key='index'>
|
||||
<view class='money acea-row row-column row-center-wrapper' :class='item.isUse?"moneyGray":""'>
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view>¥<text class='num'>{{item.money?Number(item.money):''}}</text></view>
|
||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<view class='coupon-window' :class='window==true?"on":""'>
|
||||
<view class='couponWinList'>
|
||||
<view class='item acea-row row-between-wrapper' v-for="(item,index) in couponList" :key="index">
|
||||
<view class='money font-color'>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class='money font-color'>¥<text class='num'>{{ item.money?Number(item.money):'' }}</text></view>
|
||||
<view class='text'>
|
||||
<view class='name'>购物买{{item.minPrice}}减{{item.money}}</view>
|
||||
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
|
||||
|
|
|
@ -0,0 +1,239 @@
|
|||
<template>
|
||||
<view v-if="isUp">
|
||||
<view class="mobile-bg" @click="close"></view>
|
||||
<view class="mobile-mask animated" :class="{slideInUp:isUp}">
|
||||
<view class="input-item">
|
||||
<input type="text" v-model="account" placeholder="输入手机号" />
|
||||
</view>
|
||||
<view class="input-item">
|
||||
<input type="text" v-model="codeNum" placeholder="输入验证码" />
|
||||
<button class="code" :disabled="disabled" @click="code">{{text}}</button>
|
||||
</view>
|
||||
<view class="sub_btn" @click="loginBtn">立即登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import Routine from '@/libs/routine';
|
||||
import {
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
getCodeApi,
|
||||
getUserInfo,
|
||||
phoneSilenceAuth,
|
||||
phoneWxSilenceAuth
|
||||
} from "@/api/user";
|
||||
import { bindingPhone } from '@/api/api.js'
|
||||
import { getUserPhone } from '@/api/public';
|
||||
export default{
|
||||
name:'login_mobile',
|
||||
props:{
|
||||
isUp:{
|
||||
type:Boolean,
|
||||
default:false,
|
||||
},
|
||||
authKey:{
|
||||
type:String,
|
||||
default:'',
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
keyCode:'',
|
||||
account:'',
|
||||
codeNum:''
|
||||
}
|
||||
},
|
||||
mixins: [sendVerifyCode],
|
||||
mounted() {
|
||||
//this.getCode();
|
||||
},
|
||||
methods:{
|
||||
// 获取验证码
|
||||
async code() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
await registerVerify(that.account).then(res=>{
|
||||
that.$util.Tips({title:res.msg});
|
||||
that.sendCode();
|
||||
}).catch(err=>{
|
||||
return that.$util.Tips({
|
||||
title:err
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取验证码api
|
||||
getCode() {
|
||||
let that = this
|
||||
getCodeApi().then(res => {
|
||||
that.keyCode = res.data.key;
|
||||
}).catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
close(){
|
||||
this.$emit('close',false)
|
||||
},
|
||||
// 登录
|
||||
loginBtn(){
|
||||
let that = this
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (!that.codeNum) return that.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
if (!/^[\w\d]+$/i.test(that.codeNum)) return that.$util.Tips({
|
||||
title: '请输入正确的验证码'
|
||||
});
|
||||
uni.showLoading({ title: '正在登录中' });
|
||||
getUserPhone({
|
||||
captcha: that.codeNum,
|
||||
phone: that.account,
|
||||
spid: app.globalData.spid,
|
||||
spread: app.globalData.code,
|
||||
type: 'public',
|
||||
key: this.authKey
|
||||
}).then(res=>{
|
||||
let time = res.data.expires_time - this.$Cache.time();
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.data.token,
|
||||
time: time
|
||||
});
|
||||
this.getUserInfo();
|
||||
}).catch(error=>{
|
||||
uni.hideLoading()
|
||||
this.$util.Tips({
|
||||
title:error
|
||||
})
|
||||
})
|
||||
},
|
||||
// #ifdef MP
|
||||
phoneSilenceAuth(code){
|
||||
let self = this
|
||||
phoneSilenceAuth({
|
||||
code:code,
|
||||
spid: app.globalData.spid,
|
||||
spread: app.globalData.code,
|
||||
phone:this.account,
|
||||
captcha:this.codeNum
|
||||
}).then(res=>{
|
||||
let time = res.data.expires_time - this.$Cache.time();
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.data.token,
|
||||
time: time
|
||||
});
|
||||
this.getUserInfo();
|
||||
}).catch(error=>{
|
||||
self.$util.Tips({
|
||||
title:error
|
||||
})
|
||||
})
|
||||
},
|
||||
// #endif
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
*/
|
||||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
uni.hideLoading();
|
||||
that.userInfo = res.data
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
// #ifdef MP
|
||||
that.$util.Tips({
|
||||
title:'登录成功',
|
||||
icon:'success'
|
||||
},{
|
||||
tab:3
|
||||
})
|
||||
that.close()
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
that.$emit('wechatPhone',true)
|
||||
// #endif
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
.mobile-bg{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0,0,0,0.5);
|
||||
}
|
||||
.mobile-mask {
|
||||
z-index: 20;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
padding: 67rpx 30rpx;
|
||||
background: #fff;
|
||||
.input-item{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
margin-bottom: 38rpx;
|
||||
input{
|
||||
flex: 1;
|
||||
display: block;
|
||||
height: 100%;
|
||||
padding-left: 40rpx;
|
||||
border-radius: 43rpx;
|
||||
border: 1px solid #DCDCDC;
|
||||
}
|
||||
.code{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 220rpx;
|
||||
height: 86rpx;
|
||||
margin-left: 30rpx;
|
||||
background: rgba(233, 51, 35, 0.05);
|
||||
font-size: 28rpx;
|
||||
color: #E93323;
|
||||
border-radius: 43rpx;
|
||||
&[disabled]{
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.sub_btn{
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
margin-top: 60rpx;
|
||||
background: #E93323;
|
||||
border-radius: 43rpx;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.animated{
|
||||
animation-duration:.4s
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view v-if="isPhoneBox">
|
||||
<view class="mobile-bg" @click="close"></view>
|
||||
<view class="mobile-mask animated" :class="{slideInUp:isUp}">
|
||||
<view class="info-box">
|
||||
<image :src="logoUrl"></image>
|
||||
<view class="title">获取授权</view>
|
||||
<view class="txt">获取微信的手机号授权</view>
|
||||
</view>
|
||||
<button class="sub_btn" open-type="getPhoneNumber" @getphonenumber="getphonenumber">获取微信手机号</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import Routine from '@/libs/routine';
|
||||
import {
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
getCodeApi,
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
import { getLogo, silenceAuth, getUserPhone } from '@/api/public';
|
||||
export default{
|
||||
name:'routine_phone',
|
||||
props:{
|
||||
isPhoneBox:{
|
||||
type:Boolean,
|
||||
default:false,
|
||||
},
|
||||
logoUrl:{
|
||||
type:String,
|
||||
default:'',
|
||||
},
|
||||
authKey:{
|
||||
type:String,
|
||||
default:'',
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
keyCode:'',
|
||||
account:'',
|
||||
codeNum:'',
|
||||
isStatus:false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods:{
|
||||
// #ifdef MP
|
||||
// 小程序获取手机号码
|
||||
getphonenumber(e){
|
||||
console.log(e)
|
||||
uni.showLoading({ title: '加载中' });
|
||||
Routine.getCode()
|
||||
.then(code => {
|
||||
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
|
||||
})
|
||||
.catch(error => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
// 小程序获取手机号码回调
|
||||
getUserPhoneNumber(encryptedData, iv, code) {
|
||||
getUserPhone({
|
||||
encryptedData: encryptedData,
|
||||
iv: iv,
|
||||
code: code,
|
||||
spid: app.globalData.spid,
|
||||
spread: app.globalData.code,
|
||||
key:this.authKey,
|
||||
type: 'routine'
|
||||
})
|
||||
.then(res => {
|
||||
let time = res.data.expires_time - this.$Cache.time();
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.data.token,
|
||||
time: time
|
||||
});
|
||||
this.getUserInfo();
|
||||
})
|
||||
.catch(res => {
|
||||
console.log(res);
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
*/
|
||||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
uni.hideLoading();
|
||||
that.userInfo = res.data
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
that.isStatus = true
|
||||
this.close()
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
close(){
|
||||
this.$emit('close',{isStatus:this.isStatus})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mobile-bg{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0,0,0,0.5);
|
||||
}
|
||||
.mobile-mask {
|
||||
z-index: 20;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
padding: 67rpx 30rpx;
|
||||
background: #fff;
|
||||
.info-box{
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
image{
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.title{
|
||||
margin-top: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
.txt{
|
||||
font-size: 30rpx;
|
||||
color: #868686;
|
||||
}
|
||||
}
|
||||
.sub_btn{
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
margin-top: 60rpx;
|
||||
background: #E93323;
|
||||
border-radius: 43rpx;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.animated{
|
||||
animation-duration:.4s
|
||||
}
|
||||
</style>
|
|
@ -83,7 +83,7 @@
|
|||
index:index
|
||||
}
|
||||
this.parentEmit(obj)
|
||||
// this.$parent.currentTab = index //设置swiper的第几页
|
||||
this.$parent.currentTab = index //设置swiper的第几页
|
||||
},
|
||||
// 导航子类点击
|
||||
childTab(tabClick,index){
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import store from "../store";
|
||||
import Cache from '../utils/cache';
|
||||
import { Debounce } from '@/utils/validate.js'
|
||||
// #ifdef H5 || APP-PLUS
|
||||
import { isWeixin } from "../utils";
|
||||
import auth from './wechat';
|
||||
|
@ -10,31 +11,74 @@ import { LOGIN_STATUS, USER_INFO, EXPIRES_TIME, STATE_R_KEY} from './../config/c
|
|||
function prePage(){
|
||||
let pages = getCurrentPages();
|
||||
let prePage = pages[pages.length - 1];
|
||||
// #ifndef APP-PLUS
|
||||
return prePage.route;
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
return prePage.$page.fullPath;
|
||||
// #endif
|
||||
}
|
||||
|
||||
export function toLogin(push, pathLogin) {
|
||||
export const toLogin = Debounce(_toLogin,800)
|
||||
|
||||
export function _toLogin(push, pathLogin) {
|
||||
store.commit("LOGOUT");
|
||||
let path = prePage();
|
||||
// #ifdef H5
|
||||
path = location.href;
|
||||
// path = location.href;
|
||||
path = location.pathname + location.search;
|
||||
// #endif
|
||||
if(!pathLogin)
|
||||
pathLogin = '/page/users/login/index'
|
||||
Cache.set('login_back_url',path);
|
||||
// #ifdef H5 || APP-PLUS
|
||||
// #ifdef H5
|
||||
if (isWeixin()) {
|
||||
auth.oAuth();
|
||||
// auth.oAuth();
|
||||
let urlData = location.pathname + location.search
|
||||
if (urlData.indexOf('?') !== -1) {
|
||||
urlData += '&go_longin=1';
|
||||
} else {
|
||||
if (path !== pathLogin) {
|
||||
push ? uni.navigateTo({
|
||||
url:'/pages/users/login/index'
|
||||
}) : uni.reLaunch({
|
||||
url: '/pages/users/login/index'
|
||||
urlData += '?go_longin=1';
|
||||
}
|
||||
console.log('ppppp',Cache.has('snsapiKey'))
|
||||
if (Cache.has('snsapiKey')) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/wechat_login/index',
|
||||
});
|
||||
}
|
||||
// if (!Cache.has('snsapiKey')) {
|
||||
|
||||
// auth.oAuth('snsapi_base', urlData);
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/users/wechat_login/index',
|
||||
// });
|
||||
// }
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/login/index'
|
||||
})
|
||||
// if (path !== pathLogin) {
|
||||
// push ? uni.navigateTo({
|
||||
// url:'/pages/users/login/index'
|
||||
// }) : uni.reLaunch({
|
||||
// url: '/pages/users/login/index'
|
||||
// });
|
||||
// }
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/wechat_login/index'
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/login/index'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ import { checkLogin } from './login';
|
|||
import { login } from '../api/public';
|
||||
import Cache from '../utils/cache';
|
||||
import { STATE_R_KEY, USER_INFO, EXPIRES_TIME, LOGIN_STATUS} from './../config/cache';
|
||||
|
||||
class Routine
|
||||
{
|
||||
|
||||
|
@ -65,9 +64,6 @@ class Routine
|
|||
async getCode(){
|
||||
let provider = await this.getProvider();
|
||||
return new Promise((resolve,reject)=>{
|
||||
if(Cache.has(STATE_R_KEY)){
|
||||
return resolve(Cache.get(STATE_R_KEY));
|
||||
}
|
||||
uni.login({
|
||||
provider:provider,
|
||||
success(res) {
|
||||
|
@ -122,14 +118,18 @@ class Routine
|
|||
|
||||
authUserInfo(code,data)
|
||||
{
|
||||
console.log('code:',code);
|
||||
console.log('data:',data);
|
||||
return new Promise((resolve, reject)=>{
|
||||
login(code,data).then(res=>{
|
||||
if(res.data.type==='login'){
|
||||
// let time = res.data.expiresTime - Cache.time();
|
||||
store.commit('UPDATE_USERINFO', res.data.user);
|
||||
store.commit('LOGIN', {token:res.data.token});
|
||||
store.commit('SETUID', res.data.user.uid);
|
||||
// Cache.set(EXPIRES_TIME,res.data.expiresTime,time);
|
||||
Cache.set(USER_INFO,res.data.user);
|
||||
}
|
||||
return resolve(res);
|
||||
}).catch(res=>{
|
||||
return reject(res);
|
||||
|
|
|
@ -153,12 +153,37 @@ class AuthWechat {
|
|||
/**
|
||||
* 自动去授权
|
||||
*/
|
||||
oAuth() {
|
||||
if (uni.getStorageSync(WX_AUTH) && store.state.app.token) return;
|
||||
oAuth(snsapiBase,url) {
|
||||
if (uni.getStorageSync(WX_AUTH) && store.state.app.token && snsapiBase == 'snsapi_base') return;
|
||||
const {
|
||||
code
|
||||
} = parseQuery();
|
||||
if (!code) return this.toAuth();
|
||||
if (!code || code == uni.getStorageSync('snsapiCode')){
|
||||
return this.toAuth(snsapiBase,url);
|
||||
}else{
|
||||
if(Cache.has('snsapiKey'))
|
||||
return this.auth(code).catch(error=>{
|
||||
uni.showToast({
|
||||
title:error,
|
||||
icon:'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
// if (uni.getStorageSync(WX_AUTH) && store.state.app.token) return;
|
||||
// const {
|
||||
// code
|
||||
// } = parseQuery();
|
||||
// if (!code){
|
||||
// return this.toAuth(snsapiBase,url);
|
||||
// }else{
|
||||
// if(Cache.has('snsapiKey'))
|
||||
// return this.auth(code).catch(error=>{
|
||||
// uni.showToast({
|
||||
// title:error,
|
||||
// icon:'none'
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
||||
clearAuthStatus() {
|
||||
|
@ -188,7 +213,7 @@ class AuthWechat {
|
|||
Cache.clear(STATE_KEY);
|
||||
// Cache.clear('spread');
|
||||
loginType && Cache.clear(LOGINTYPE);
|
||||
resolve();
|
||||
resolve(data);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
|
@ -198,9 +223,15 @@ class AuthWechat {
|
|||
* 获取跳转授权后的地址
|
||||
* @param {Object} appId
|
||||
*/
|
||||
getAuthUrl(appId) {
|
||||
getAuthUrl(appId,snsapiBase,backUrl) {
|
||||
let url = `${location.origin}${backUrl}`
|
||||
if(url.indexOf('?') == -1){
|
||||
url = url+'?'
|
||||
}else{
|
||||
url = url+'&'
|
||||
}
|
||||
const redirect_uri = encodeURIComponent(
|
||||
`${location.origin}/pages/auth/index?back_url=` +
|
||||
`${url}scope=${snsapiBase}&back_url=` +
|
||||
encodeURIComponent(
|
||||
encodeURIComponent(
|
||||
uni.getStorageSync(BACK_URL) ?
|
||||
|
@ -214,16 +245,20 @@ class AuthWechat {
|
|||
("" + Math.random()).split(".")[1] + "authorizestate"
|
||||
);
|
||||
uni.setStorageSync(STATE_KEY, state);
|
||||
if(snsapiBase==='snsapi_base'){
|
||||
return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=${state}#wechat_redirect`;
|
||||
}else{
|
||||
return `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=${state}#wechat_redirect`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转自动登录
|
||||
*/
|
||||
toAuth() {
|
||||
toAuth(snsapiBase,backUrl) {
|
||||
let that = this;
|
||||
this.wechat().then(wx => {
|
||||
location.href = this.getAuthUrl(that.initConfig.appId);
|
||||
location.href = this.getAuthUrl(that.initConfig.appId,snsapiBase,backUrl);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
2
main.js
|
@ -46,7 +46,7 @@ if (vconsole !== undefined && vconsole === md5Crmeb) {
|
|||
let vConsole = new VConsole();
|
||||
}
|
||||
|
||||
Auth.isWeixin() && Auth.oAuth();
|
||||
// Auth.isWeixin() && Auth.oAuth();
|
||||
|
||||
// #endif
|
||||
|
||||
|
|
|
@ -360,6 +360,13 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "商品评价"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "wechat_login/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账户登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class='bargain-list'>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'" v-if="returnShow"></view>
|
||||
<!-- #endif -->
|
||||
<view class='header'></view>
|
||||
<view class='list'>
|
||||
<block v-for="(item,index) in bargainList" :key="index">
|
||||
|
@ -23,7 +25,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -72,6 +74,17 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.getBargainList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
var pages = getCurrentPages();
|
||||
this.returnShow = pages.length===1?false:true;
|
||||
|
@ -83,13 +96,7 @@
|
|||
this.getUserInfo();
|
||||
this.getBargainList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
<view>
|
||||
<view :style="'height:'+systemH+'px'"></view>
|
||||
<view class='bargain'>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<view class='iconfont icon-xiangzuo' v-if='retunTop' @tap='goBack' :style="'top:'+navH+'px'"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="header" :class="bargainUid != userInfo.uid ? 'on' : ''">
|
||||
<view class='people' >
|
||||
<!-- :style="'top:'+navH/2+'rpx'" -->
|
||||
|
@ -202,12 +205,26 @@
|
|||
</view>
|
||||
<view class='mask' catchtouchmove="true" v-show='active==true' @tap='close'></view>
|
||||
</view>
|
||||
<!-- 分享按钮 -->
|
||||
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="item" @click="appShare('WXSceneSession')">
|
||||
<view class="iconfont icon-weixin3"></view>
|
||||
<view class="">微信好友</view>
|
||||
</view>
|
||||
<view class="item" @click="appShare('WXSenceTimeline')">
|
||||
<view class="iconfont icon-pengyouquan"></view>
|
||||
<view class="">微信朋友圈</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- 发送给朋友图片 -->
|
||||
<view class="share-box" v-if="H5ShareBox">
|
||||
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -243,6 +260,12 @@
|
|||
import home from '@/components/home';
|
||||
import parser from "@/components/jyf-parser/jyf-parser";
|
||||
import { silenceBindingSpread } from "@/utils";
|
||||
// #ifdef APP-PLUS
|
||||
import {
|
||||
TOKENNAME,
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app.js';
|
||||
// #endif
|
||||
const app = getApp();
|
||||
|
||||
export default {
|
||||
|
@ -307,6 +330,17 @@
|
|||
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getBargainDetails();
|
||||
this.addShareBargain();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
@ -357,13 +391,7 @@
|
|||
// '&spid=' + e.detail.uid;
|
||||
// this.$set(that, 'bargainPartake', e.detail.uid);
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -373,6 +401,39 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
// app分享
|
||||
// #ifdef APP-PLUS
|
||||
appShare(scene) {
|
||||
let that = this
|
||||
console.log(HTTP_REQUEST_URL)
|
||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||
let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
|
||||
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: scene,
|
||||
type: 0,
|
||||
href: `${HTTP_REQUEST_URL}${curRoute}`,
|
||||
title: that.bargainInfo.title,
|
||||
imageUrl: that.bargainInfo.image,
|
||||
success: function(res) {
|
||||
uni.showToast({
|
||||
title: '分享成功',
|
||||
icon: 'success'
|
||||
})
|
||||
that.posters = false;
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.showToast({
|
||||
title: '分享失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
that.posters = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
openTap() {
|
||||
this.$set(this,'couponsHidden',!this.couponsHidden);
|
||||
},
|
||||
|
@ -485,6 +546,7 @@
|
|||
},
|
||||
currentBargainUser: function() { //当前用户砍价
|
||||
this.$set(this, 'bargainUid', this.userInfo.uid);
|
||||
this.page = 1;
|
||||
this.setBargain();
|
||||
},
|
||||
setBargain: function() { //参与砍价
|
||||
|
@ -557,14 +619,6 @@
|
|||
that.$set(that, 'bargainUserHelpList', bargainUserHelpList);
|
||||
that.$set(that, 'limitStatus', datas.limit > len);
|
||||
that.$set(that, 'page', that.page + 1);
|
||||
|
||||
// var bargainUserHelpListNew = [];
|
||||
// var bargainUserHelpList = that.bargainUserHelpList;
|
||||
// var len = res.data.list.length;
|
||||
// bargainUserHelpListNew = bargainUserHelpList.concat(res.data.list);
|
||||
// that.$set(that, 'bargainUserHelpList', res.data.list);
|
||||
// that.$set(that, 'limitStatus', datas.limit > len);
|
||||
// that.$set(that, 'page', (Number(datas.page) + Number(datas.limit)));
|
||||
});
|
||||
},
|
||||
getBargainUserBargainPricePoster: function() {
|
||||
|
@ -641,7 +695,6 @@
|
|||
configTimeline
|
||||
)
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch(res => {
|
||||
if (res.is_ready) {
|
||||
|
@ -718,6 +771,38 @@
|
|||
page {
|
||||
background-color: #e93323 !important;
|
||||
}
|
||||
.generate-posters {
|
||||
width: 100%;
|
||||
height: 170rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 300;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.generate-posters.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.generate-posters .item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.generate-posters .item .iconfont {
|
||||
font-size: 80rpx;
|
||||
color: #5eae72;
|
||||
}
|
||||
|
||||
.generate-posters .item .iconfont.icon-haibao {
|
||||
color: #5391f1;
|
||||
}
|
||||
|
||||
.bargain .bargainGang .open {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
|
@ -797,7 +882,7 @@
|
|||
font-size: 20rpx;
|
||||
position: absolute;
|
||||
width: 85%;
|
||||
/* #ifdef MP */
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
/* #endif */
|
||||
|
|
|
@ -39,22 +39,24 @@
|
|||
</div>
|
||||
<!-- #ifdef H5 -->
|
||||
<div v-if="userBool === 1 && isOk == 0 && pinkBool === 0">
|
||||
<div class="teamBnt bg-color-red" v-if="$wechat.isWeixin()" @click="H5ShareBox = true">邀请好友参团</div>
|
||||
<div class="teamBnt bg-color-red" v-else @click="goPoster">邀请好友参团</div>
|
||||
<div class="teamBnt bg-color-red" v-if="$wechat.isWeixin() && pinkT.stopTime>timestamp" @click="H5ShareBox = true">邀请好友参团</div>
|
||||
<div class="teamBnt bg-color-red" v-if='!$wechat.isWeixin() && pinkT.stopTime>timestamp' @click="goPoster">邀请好友参团</div>
|
||||
</div>
|
||||
<!-- <div class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0" @click="goPoster">
|
||||
邀请好友参团
|
||||
</div> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<button open-type="share" class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0">邀请好友参团</button>
|
||||
<button open-type="share" class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0 && pinkT.stopTime>timestamp">邀请好友参团</button>
|
||||
<!-- #endif -->
|
||||
<div class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0" @click="pay">我要参团</div>
|
||||
<div class="teamBnt bg-color-hui" v-if="pinkT.stopTime<timestamp && isOk == 0 && pinkBool === 0">拼团已过期</div>
|
||||
<div class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0 && pinkT.stopTime>timestamp" @click="pay">我要参团</div>
|
||||
<div class="teamBnt bg-color-red" v-if="pinkBool === 1 || pinkBool === -1" @click="goDetail(storeCombination.id)">再次开团</div>
|
||||
<div class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
|
||||
<span class="iconfont icon-guanbi3"></span>
|
||||
取消开团
|
||||
</div>
|
||||
|
||||
<div class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
|
||||
查看订单信息
|
||||
<span class="iconfont icon-xiangyou"></span>
|
||||
|
@ -93,10 +95,10 @@
|
|||
<!-- 发送给朋友图片 -->
|
||||
<view class="share-box" v-if="H5ShareBox"><image src="/static/images/share-info.png" @click="H5ShareBox = false"></image></view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<!-- <Product-window v-on:changeFun="changeFun" :attr="attr" :limitNum='1' :iSbnt='1'></Product-window> -->
|
||||
<home></home>
|
||||
<!-- <Product-window v-on:changeFun="changeFun" :attr="attr" :limitNum='1' :iSbnt='1'></Product-window> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -162,9 +164,29 @@ export default {
|
|||
H5ShareBox: false, //公众号分享图片
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
onceNum: 0 //一次可以购买几个
|
||||
onceNum: 0 ,//一次可以购买几个,
|
||||
timestamp: 0 // 当前时间戳
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getCombinationPink();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
},
|
||||
userData:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.userInfo = newV;
|
||||
app.globalData.openPages = '/pages/activity/goods_combination_status/index?id=' + this.pinkId;
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
computed: mapGetters({
|
||||
'isLogin':'isLogin',
|
||||
'userData':'userInfo'
|
||||
|
@ -173,14 +195,9 @@ export default {
|
|||
var that = this;
|
||||
that.pinkId = options.id;
|
||||
if (that.isLogin == false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.isAuto = true;
|
||||
that.$set(that, 'isShowAuth', true);
|
||||
// #endif
|
||||
} else {
|
||||
this.timestamp = (new Date()).getTime();
|
||||
// #ifdef H5
|
||||
this.getCombinationPink();
|
||||
// #endif
|
||||
|
@ -196,8 +213,6 @@ export default {
|
|||
*/
|
||||
onShareAppMessage: function() {
|
||||
let that = this;
|
||||
that.close();
|
||||
that.addShareBargain();
|
||||
return {
|
||||
title: '您的好友' + that.userInfo.nickname + '邀请您参团' + that.storeCombination.title,
|
||||
path: app.globalData.openPages,
|
||||
|
@ -505,17 +520,13 @@ export default {
|
|||
if (that.attr.productAttr != 0) that.DefaultSelect();
|
||||
})
|
||||
.catch(err => {
|
||||
this.$util.Tips({
|
||||
if(that.isLogin){
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
}, {
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
uni.redirectTo({
|
||||
success(){},
|
||||
fail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//#ifdef H5
|
||||
|
|
|
@ -3,22 +3,19 @@
|
|||
<view class='flash-sale'>
|
||||
<view class="saleBox"></view>
|
||||
<!-- banner -->
|
||||
<view class="header" v-if="timeList.length">
|
||||
<swiper indicator-dots="true" autoplay="true" :circular="circular" interval="3000" duration="1500"
|
||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
|
||||
<block v-for="(item,index) in JSON.parse(timeList[active].slide)" :key="index">
|
||||
<swiper-item>
|
||||
<image :src="item.sattDir" class="slide-image" lazy-load></image>
|
||||
<!-- <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
|
||||
<image :src="item.pic" class="slide-image" lazy-load></image>
|
||||
</navigator> -->
|
||||
<view class="header" v-if="timeList.length">
|
||||
<swiper indicator-dots="true" autoplay="true" :circular="circular" interval="3000" duration="1500"
|
||||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
|
||||
<block v-for="(item,index) in timeList[active].slide" :key="index">
|
||||
<swiper-item>
|
||||
<image :src="item.sattDir" class="slide-image" lazy-load></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- <view class='header' v-if="timeList.length>0">
|
||||
<image :src='timeList[active].slide'></image>
|
||||
</view> -->
|
||||
<view class="seckillList acea-row row-between-wrapper">
|
||||
<view class="priceTag">
|
||||
<image src="/static/images/priceTag.png"></image>
|
||||
|
@ -99,7 +96,7 @@
|
|||
loading: false,
|
||||
loadend: false,
|
||||
pageloading: false,
|
||||
seckillHeader: [],
|
||||
seckillHeader: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -109,10 +106,12 @@
|
|||
getSeckillConfig: function() {
|
||||
let that = this;
|
||||
getSeckillHeaderApi().then(res => {
|
||||
res.data.seckillTime.map(item => {
|
||||
item.slide = JSON.parse(item.slide)
|
||||
})
|
||||
that.timeList = res.data.seckillTime;
|
||||
that.active = res.data.seckillTimeIndex;
|
||||
if (that.timeList.length) {
|
||||
// wxh.time(that.data.timeList[that.data.active].stop, that);
|
||||
that.scrollLeft = (that.active - 1.37) * 100
|
||||
setTimeout(function() {
|
||||
that.loading = true
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
|
||||
@attrVal="attrVal" @iptCartNum="iptCartNum"></product-window>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
<!-- 分享按钮 -->
|
||||
|
@ -272,7 +272,8 @@
|
|||
sharePacket: {
|
||||
isState: true, //默认不显示
|
||||
},
|
||||
buyNum: 1
|
||||
buyNum: 1,
|
||||
errT: ''
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -288,6 +289,18 @@
|
|||
// #endif
|
||||
},
|
||||
computed: mapGetters(['isLogin','uid','chatUrl']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getSeckillDetail();
|
||||
this.getProductReplyList();
|
||||
this.getProductReplyCount();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
||||
let that = this
|
||||
|
@ -337,13 +350,7 @@
|
|||
this.getProductReplyList();
|
||||
this.getProductReplyCount();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -828,9 +835,20 @@
|
|||
*/
|
||||
goPoster: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: '海报生成中',
|
||||
mask: true
|
||||
});
|
||||
that.posters = false;
|
||||
let arrImagesUrl = '';
|
||||
let arrImagesUrlTop = '';
|
||||
if(!that.PromotionCode){
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: that.errT
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.downloadFile({
|
||||
url: that.imgTop, //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
|
@ -842,8 +860,9 @@
|
|||
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
uni.hideLoading();
|
||||
});
|
||||
}, 200);
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -859,7 +878,9 @@
|
|||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
});
|
||||
})
|
||||
}).catch(err => {
|
||||
that.errT = err;
|
||||
});
|
||||
},
|
||||
// 生成二维码;
|
||||
make() {
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
// location.replace("/");
|
||||
console.log('auth错误='+err);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<template>
|
||||
<view class='productSort copy-data'>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="sys-head" :style="{height:sysHeight}"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class='header acea-row row-center-wrapper'>
|
||||
<view class='acea-row row-between-wrapper input'>
|
||||
<text class='iconfont icon-sousuo'></text>
|
||||
|
@ -44,6 +48,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
import {
|
||||
getCategoryList
|
||||
} from '@/api/store.js';
|
||||
|
@ -58,7 +63,8 @@
|
|||
height: 0,
|
||||
hightArr: [],
|
||||
toView: "",
|
||||
tabbarH: 0
|
||||
tabbarH: 0,
|
||||
sysHeight: sysHeight,
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
@ -133,6 +139,9 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sys-head{
|
||||
background-color: #fff;
|
||||
}
|
||||
.productSort .header {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
<view class="mask" v-if="posters" @click="closePosters"></view>
|
||||
<view class="mask" v-if="canvasStatus" @click="listenerActionClose"></view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<!-- 海报展示 -->
|
||||
<view class='poster-pop' v-if="canvasStatus">
|
||||
|
@ -356,10 +356,29 @@
|
|||
qrcodeSize: 600,
|
||||
canvasStatus: false,//是否显示海报
|
||||
imagePath:'',//海报路径
|
||||
imgTop:''
|
||||
imgTop:'',
|
||||
errT: ''
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'uid', 'chatUrl']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV == true) {
|
||||
this.getCouponList();
|
||||
this.getCartCount();
|
||||
this.downloadFilePromotionCode();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
storeInfo: {
|
||||
handler: function() {
|
||||
this.$nextTick(() => {});
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// this.getChat(this.uid || '');
|
||||
let that = this
|
||||
|
@ -885,13 +904,7 @@
|
|||
setCollect: function() {
|
||||
let that = this;
|
||||
if (this.isLogin === false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
} else {
|
||||
if (this.storeInfo.userCollect) {
|
||||
collectDel(this.storeInfo.id).then(res => {
|
||||
|
@ -917,13 +930,7 @@
|
|||
couponTap: function() {
|
||||
let that = this;
|
||||
if (that.isLogin === false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.$set(that, 'isAuto', true);
|
||||
that.$set(that, 'isShowAuth', true);
|
||||
// #endif
|
||||
} else {
|
||||
that.getCouponList();
|
||||
that.$set(that.coupon, 'coupon', true);
|
||||
|
@ -940,13 +947,7 @@
|
|||
joinCart: function(e) {
|
||||
//是否登录
|
||||
if (this.isLogin === false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.$set(this, 'isAuto', true);
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
} else {
|
||||
this.goCat();
|
||||
}
|
||||
|
@ -1035,13 +1036,7 @@
|
|||
*/
|
||||
goBuy: function(e) {
|
||||
if (this.isLogin === false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.$set(this, 'isAuto', true);
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
} else {
|
||||
this.goCat(true);
|
||||
}
|
||||
|
@ -1056,13 +1051,7 @@
|
|||
*/
|
||||
listenerActionSheet: function() {
|
||||
if (this.isLogin === false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.$set(this, 'isAuto', true);
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef H5
|
||||
if (this.$wechat.isWeixin() === true) {
|
||||
|
@ -1120,14 +1109,12 @@
|
|||
path: 'pages/goods_details/index'
|
||||
}
|
||||
getQrcode(data).then(res=>{
|
||||
//that.PromotionCode = res.data.code;
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
});
|
||||
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
that.errT = err;
|
||||
});
|
||||
},
|
||||
// 生成二维码;
|
||||
|
@ -1191,9 +1178,20 @@
|
|||
*/
|
||||
goPoster: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: '海报生成中',
|
||||
mask: true
|
||||
});
|
||||
that.posters = false;
|
||||
let arrImagesUrl = '';
|
||||
let arrImagesUrlTop = '';
|
||||
if(!that.PromotionCode){
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: that.errT
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.downloadFile({
|
||||
url: that.imgTop, //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
|
@ -1205,8 +1203,9 @@
|
|||
that.$util.PosterCanvas(arrImages, storeName, price, that.storeInfo.otPrice,function(tempFilePath) {
|
||||
that.imagePath = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
uni.hideLoading();
|
||||
});
|
||||
}, 200);
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<view>
|
||||
<view class='productList'>
|
||||
<view class='search bg-color acea-row row-between-wrapper'>
|
||||
<view class="iconfont icon-xiangzuo" @click="goback()"></view>
|
||||
<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
|
||||
<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search" :value='where.keyword'
|
||||
@confirm="searchSubmit"></input>
|
||||
|
@ -105,6 +106,16 @@
|
|||
this.get_host_product();
|
||||
},
|
||||
methods: {
|
||||
goback(){
|
||||
// #ifdef H5
|
||||
return history.back();
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
return uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
// 去详情页
|
||||
godDetail(item){
|
||||
goShopDetail(item,this.uid).then(res=>{
|
||||
|
@ -144,14 +155,7 @@
|
|||
set_where: function(e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
// #ifdef H5
|
||||
return history.back();
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
return uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
// #endif
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
if (this.price == 0) this.price = 1;
|
||||
|
@ -176,11 +180,11 @@
|
|||
//设置where条件
|
||||
setWhere: function() {
|
||||
if (this.price == 0) this.where.priceOrder = '';
|
||||
else if (this.price == 1) this.where.priceOrder = 'desc';
|
||||
else if (this.price == 2) this.where.priceOrder = 'asc';
|
||||
else if (this.price == 1) this.where.priceOrder = 'asc';
|
||||
else if (this.price == 2) this.where.priceOrder = 'desc';
|
||||
if (this.stock == 0) this.where.salesOrder = '';
|
||||
else if (this.stock == 1) this.where.salesOrder = 'desc';
|
||||
else if (this.stock == 2) this.where.salesOrder = 'asc';
|
||||
else if (this.stock == 1) this.where.salesOrder = 'asc';
|
||||
else if (this.stock == 2) this.where.salesOrder = 'desc';
|
||||
this.where.news = this.nows ? 1 : 0;
|
||||
},
|
||||
//查找产品
|
||||
|
@ -222,6 +226,9 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.iconfont{
|
||||
color: #fff;
|
||||
}
|
||||
.productList .search {
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
|
@ -234,7 +241,7 @@
|
|||
}
|
||||
|
||||
.productList .search .input {
|
||||
width: 640rpx;
|
||||
// width: 640rpx;
|
||||
height: 60rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 50rpx;
|
||||
|
@ -243,7 +250,7 @@
|
|||
}
|
||||
|
||||
.productList .search .input input {
|
||||
width: 548rpx;
|
||||
width: 528rpx;
|
||||
height: 100%;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<template>
|
||||
<view :class="{borderShow:isBorader}">
|
||||
<view class="combination" v-if="combinationList.length">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="title acea-row row-right">
|
||||
<!-- <view class="acea-row row-middle">
|
||||
<view class="sign">
|
||||
<image src="../../../static/images/sign02.png"></image>
|
||||
</view>
|
||||
<view class="name">拼团惠<text>享超值开团价</text></view>
|
||||
</view>
|
||||
<navigator url="/pages/activity/goods_combination/index" hover-class="none" class="more acea-row row-center-wrapper">超值精选<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view> -->
|
||||
<navigator url="/pages/activity/goods_combination/index" hover-class="none" class="more acea-row row-center-wrapper">更多<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view>
|
||||
<view class="conter acea-row">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
|
||||
|
@ -18,8 +18,9 @@
|
|||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<text class="money">¥<text class="num">{{item.price}}</text></text>
|
||||
<!-- <text class="y_money">¥{{item.otPrice}}</text> -->
|
||||
<view class="name line1">{{item.title}}</view>
|
||||
<view class="money">¥<text class="num">{{item.price}}</text></view>
|
||||
<view class="y_money">¥{{item.otPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -81,7 +82,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.default{
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
|
@ -95,12 +96,14 @@
|
|||
}
|
||||
}
|
||||
.combination{
|
||||
width: 690rpx;
|
||||
width: 700rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
padding: 25rpx 20rpx 21rpx 20rpx;
|
||||
|
||||
background-image: url(../../../static/images/pth.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
.title {
|
||||
.sign {
|
||||
width: 40rpx;
|
||||
|
@ -127,12 +130,9 @@
|
|||
}
|
||||
|
||||
.more {
|
||||
width: 122rpx;
|
||||
height: 37rpx;
|
||||
background: linear-gradient(270deg, #1DB0FC 0%, #22CAFD 100%);
|
||||
border-radius: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
color: #666666;
|
||||
padding-left: 2rpx;
|
||||
|
||||
.iconfont {
|
||||
|
@ -141,7 +141,7 @@
|
|||
}
|
||||
}
|
||||
.conter{
|
||||
margin-top: 18rpx;
|
||||
margin-top: 28rpx;
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 174rpx;
|
||||
|
@ -161,20 +161,26 @@
|
|||
}
|
||||
.text{
|
||||
margin-top: 4rpx;
|
||||
.money{
|
||||
.y_money {
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.name {
|
||||
font-size: 24rpx;
|
||||
color: #000;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
.money {
|
||||
color: #FD502F;
|
||||
font-size: 28rpx;
|
||||
height: 100%;
|
||||
font-weight: bold;
|
||||
margin: 2rpx 0;
|
||||
.num {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.y_money{
|
||||
color: #959595;
|
||||
text-decoration: line-through;
|
||||
font-size: 20rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<template>
|
||||
<view :class="{borderShow:isBorader}">
|
||||
<view class="combination" v-if="bargList.length">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="title acea-row row-between">
|
||||
<view class="acea-row row-column">
|
||||
<view class="sign">
|
||||
<image src="../../../static/images/sign03.png"></image>
|
||||
Hi,{{userData.nickname || '亲爱的顾客'}}!
|
||||
</view>
|
||||
<view class="name">砍价活动<text>呼朋唤友来砍价</text></view>
|
||||
<view class="name"><text>你的好友正在邀请你参与砍价</text></view>
|
||||
</view>
|
||||
<navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">品质好货<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
<navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">更多<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view>
|
||||
<view class="conter acea-row">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
|
||||
|
@ -18,8 +18,10 @@
|
|||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<text class="money">¥<text class="num">{{item.minPrice}}</text></text>
|
||||
<text class="y_money">¥{{item.price}}</text>
|
||||
<view class="name line1">{{item.title}}</view>
|
||||
<view class="money">¥<text class="num">{{item.minPrice}}</text></view>
|
||||
<view class="btn">参与砍价</view>
|
||||
<!-- <view class="y_money">¥{{item.price}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -40,7 +42,10 @@
|
|||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'c_bargain',
|
||||
computed: mapGetters(['uid']),
|
||||
computed: mapGetters({
|
||||
'userData': 'userInfo',
|
||||
'uid': 'uid'
|
||||
}),
|
||||
data() {
|
||||
return {
|
||||
bargList: [],
|
||||
|
@ -72,7 +77,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.default{
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
|
@ -87,44 +92,37 @@
|
|||
}
|
||||
.combination{
|
||||
width: 690rpx;
|
||||
background-image: url(../../../static/images/kjbj.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
// height: 288rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
padding: 25rpx 20rpx 21rpx 20rpx;
|
||||
padding: 25rpx 20rpx 25rpx 20rpx;
|
||||
|
||||
.title {
|
||||
.sign {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
font-size: 32rpx;
|
||||
color: #E93323;
|
||||
margin-bottom: 2rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
margin-left: 12rpx;
|
||||
font-weight: bold;
|
||||
|
||||
text {
|
||||
color: #797979;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.more {
|
||||
width: 122rpx;
|
||||
height: 37rpx;
|
||||
background: linear-gradient(135deg, #FF9F6C 0%, #FD502F 100%);
|
||||
border-radius: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
color: #666666;
|
||||
padding-left: 2rpx;
|
||||
|
||||
.iconfont {
|
||||
|
@ -133,7 +131,7 @@
|
|||
}
|
||||
}
|
||||
.conter{
|
||||
margin-top: 18rpx;
|
||||
margin-top: 28rpx;
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 174rpx;
|
||||
|
@ -153,19 +151,37 @@
|
|||
}
|
||||
.text{
|
||||
margin-top: 4rpx;
|
||||
.money{
|
||||
.y_money {
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.name {
|
||||
font-size: 24rpx;
|
||||
color: #000;
|
||||
margin-top: 14rpx;
|
||||
}
|
||||
.money {
|
||||
color: #FD502F;
|
||||
font-size: 28rpx;
|
||||
height: 100%;
|
||||
font-weight: bold;
|
||||
margin: 2rpx 0;
|
||||
.num {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.y_money{
|
||||
color: #959595;
|
||||
text-decoration: line-through;
|
||||
font-size: 20rpx;
|
||||
margin-left: 8rpx;
|
||||
.btn{
|
||||
width: 174rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(129deg, #FF5555 0%, #FF0000 100%);
|
||||
opacity: 1;
|
||||
border-radius: 0px 0px 14rpx 14rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 26rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,52 +63,6 @@
|
|||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 直播 -->
|
||||
<!-- #ifdef MP -->
|
||||
<!-- <block v-if="liveList.length>0">
|
||||
<navigator :url="'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id='+liveList[0].roomid" class="live-wrapper"
|
||||
v-if="liveList.length==1" hover-class="none">
|
||||
<view class="live-top" :class="liveList[0].live_status == 101?'pictrue_log_xl':liveList[0].live_status == 103?'pictrue_log_xl_gray':'pictrue_log_xl_blue'">
|
||||
<block v-if="liveList[0].live_status == 101">
|
||||
<image src="/static/images/live-01.png" mode=""></image>
|
||||
<text>直播中</text>
|
||||
</block>
|
||||
<block v-if="liveList[0].live_status == 103">
|
||||
<image src="/static/images/live-02.png" mode=""></image>
|
||||
<text>已结束</text>
|
||||
</block>
|
||||
<block v-if="liveList[0].live_status == 102">
|
||||
<image src="/static/images/live-03.png" mode=""></image>
|
||||
<text>未开始</text>
|
||||
</block>
|
||||
</view>
|
||||
<image :src="liveList[0].share_img"></image>
|
||||
<view class="live-title line1">{{liveList[0].name}}</view>
|
||||
</navigator>
|
||||
<view class="live-wrapper mores" v-else>
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex">
|
||||
<navigator hover-class="none" class="item" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id='+item.roomid">
|
||||
<view class="live-top" :class="item.type == 1?'pictrue_log_xl':item.type == 2?'pictrue_log_xl_gray':'pictrue_log_xl_blue'">
|
||||
<block v-if="item.live_status == 101">
|
||||
<image src="/static/images/live-01.png" mode=""></image>
|
||||
<text>直播中</text>
|
||||
</block>
|
||||
<block v-if="item.live_status == 103">
|
||||
<image src="/static/images/live-02.png" mode=""></image>
|
||||
<text>已结束</text>
|
||||
</block>
|
||||
<block v-if="item.live_status == 102">
|
||||
<image src="/static/images/live-03.png" mode=""></image>
|
||||
<text>未开始</text>
|
||||
</block>
|
||||
</view>
|
||||
<image :src="item.share_img"></image>
|
||||
<view class="live-title">{{item.name}}</view>
|
||||
</navigator>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</block> -->
|
||||
<!-- #endif -->
|
||||
<!-- 超值爆款 -->
|
||||
<view class="explosion">
|
||||
<view class="hd">
|
||||
|
@ -219,9 +173,9 @@
|
|||
</block>
|
||||
|
||||
</view>
|
||||
<coupon-window :window='window' :couponList="couponList" @onColse="onColse"></coupon-window>
|
||||
<!-- <coupon-window :window='window' :couponList="couponList" @onColse="onColse"></coupon-window> -->
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -361,7 +315,6 @@
|
|||
marTop: 0,
|
||||
childID: 0,
|
||||
loadend: false,
|
||||
loading: false,
|
||||
loadTitle: '加载更多',
|
||||
sortProduct: [],
|
||||
where: {
|
||||
|
@ -393,6 +346,23 @@
|
|||
point: ''
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// isLogin: {
|
||||
// deep: true, //深度监听设置为 true
|
||||
// handler: function(newV, oldV) {
|
||||
// // 优惠券弹窗
|
||||
// var newDates = new Date().toLocaleDateString();
|
||||
// if (newV) {
|
||||
// try {
|
||||
// var oldDate = uni.getStorageSync('oldDate') || '';
|
||||
// } catch {}
|
||||
// if (oldDate != newDates) {
|
||||
// this.getCoupon();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
onLoad() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
|
@ -438,7 +408,9 @@
|
|||
}
|
||||
},
|
||||
getTem(data) {
|
||||
getTemlIds({type:data}).then(res => {
|
||||
getTemlIds({
|
||||
type: data
|
||||
}).then(res => {
|
||||
if (res.data) {
|
||||
let arr = res.data.map((item) => {
|
||||
return item.tempId
|
||||
|
@ -487,7 +459,7 @@
|
|||
}, 300)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
self.prodeuctTop = 18
|
||||
self.prodeuctTop = 26
|
||||
// #endif
|
||||
this.navIndex = e.index
|
||||
let child = this.navTop[e.index].child && this.navTop[e.index].child != 'undefined' ? this.navTop[e.index].child :
|
||||
|
@ -604,6 +576,13 @@
|
|||
// #ifdef MP
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
// if (!res.authSetting['scope.userInfo']) {
|
||||
// that.window = false;
|
||||
// that.iShidden = true;
|
||||
|
||||
// } else {
|
||||
// that.window = that.couponList.length ? true : false;
|
||||
// }
|
||||
if (!res.authSetting['scope.userInfo']) {
|
||||
that.window = that.couponList.length ? true : false;
|
||||
} else {
|
||||
|
@ -614,6 +593,11 @@
|
|||
});
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
// if (that.isLogin) {
|
||||
// that.window = res.data.length ? true : false;
|
||||
// } else {
|
||||
// that.window = false;
|
||||
// }
|
||||
if (that.isLogin) {
|
||||
that.window = false;
|
||||
} else {
|
||||
|
@ -722,24 +706,25 @@
|
|||
// 首发新品详情
|
||||
goDetail(item) {
|
||||
if (item.activityH5 && item.activityH5.type === "2" && !this.isLogin) {
|
||||
// #ifdef H5
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您未登录,请登录!',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/login/index'
|
||||
})
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.$set(this, 'isAuto', true);
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
return
|
||||
toLogin();
|
||||
// // #ifdef H5
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '您未登录,请登录!',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/users/login/index'
|
||||
// })
|
||||
// } else if (res.cancel) {}
|
||||
// }
|
||||
// })
|
||||
// // #endif
|
||||
// // #ifdef MP
|
||||
// this.$set(this, 'isAuto', true);
|
||||
// this.$set(this, 'isShowAuth', true);
|
||||
// // #endif
|
||||
// return
|
||||
} else {
|
||||
goShopDetail(item, this.uid).then(res => {
|
||||
uni.navigateTo({
|
||||
|
@ -791,6 +776,7 @@
|
|||
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
|
||||
appSearchH.boundingClientRect(function(data) {
|
||||
self.searchH = data.height
|
||||
//console.log(self.searchH)
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
|
@ -827,10 +813,12 @@
|
|||
// 滚动监听
|
||||
onPageScroll(e) {
|
||||
let self = this
|
||||
if (e.scrollTop >= self.searchH) {
|
||||
if (self.sortProduct.length>4 && e.scrollTop >= self.searchH) {
|
||||
self.isFixed = true
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
self.isFixed = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -853,12 +841,8 @@
|
|||
min-height: 100%;
|
||||
background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
|
||||
|
||||
// &.bgf{
|
||||
// background: #fff;
|
||||
// }
|
||||
.header {
|
||||
width: 100%;
|
||||
height: 320rpx;
|
||||
background: linear-gradient(90deg, $bg-star 50%, $bg-end 100%);
|
||||
|
||||
.serch-wrapper {
|
||||
|
@ -1561,7 +1545,8 @@
|
|||
|
||||
.index-product-wrapper {
|
||||
margin-top: 40rpx;
|
||||
margin-bottom: 40rpx;
|
||||
margin-bottom: 110rpx;
|
||||
|
||||
&.on {
|
||||
min-height: 1500rpx;
|
||||
}
|
||||
|
@ -1682,7 +1667,9 @@
|
|||
|
||||
.productList {
|
||||
background-color: #fff;
|
||||
/* #ifdef H5 */
padding-bottom: 140rpx;
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
padding-bottom: 140rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.productList .list {
|
||||
|
@ -1787,6 +1774,7 @@
|
|||
left: 0;
|
||||
top: 0;
|
||||
background: linear-gradient(90deg, red 50%, #ff5400 100%);
|
||||
|
||||
}
|
||||
|
||||
.mores-txt {
|
||||
|
|
|
@ -113,13 +113,19 @@
|
|||
<productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
|
||||
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" @goCat="reGoCat" id='product-window'></productWindow>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// #ifdef APP-PLUS
|
||||
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
let sysHeight = 0
|
||||
// #endif
|
||||
import {
|
||||
getCartList,
|
||||
getCartCounts,
|
||||
|
@ -189,20 +195,15 @@
|
|||
attrValue: '', //已选属性
|
||||
attrTxt: '请选择', //属性页面提示
|
||||
cartId: 0,
|
||||
product_id: 0
|
||||
product_id: 0,
|
||||
sysHeight:sysHeight
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad: function(options) {
|
||||
let that = this;
|
||||
if (that.isLogin == false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.isAuto = true;
|
||||
that.$set(that, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
|
@ -593,30 +594,8 @@
|
|||
// let newArr = that.cartList.valid.filter(item => item.attrStatus);
|
||||
that.isAllSelect = newValid.length === arr1.length + arr3.length;
|
||||
that.selectValue = value;
|
||||
console.log(that.selectValue)
|
||||
that.switchSelect();
|
||||
},
|
||||
// checkboxChange: function(event) {
|
||||
// let that = this;
|
||||
// let value = event.detail.value;
|
||||
// let valid = that.cartList.valid;
|
||||
// for (let index in valid) {
|
||||
// if (that.inArray(valid[index].id, value)){
|
||||
// if(valid[index].attrStatus){
|
||||
// valid[index].checked = true;
|
||||
// }else{
|
||||
// valid[index].checked = false;
|
||||
// }
|
||||
// } else {
|
||||
// valid[index].checked = false;
|
||||
// }
|
||||
// }
|
||||
// that.$set(that.cartList, 'valid', valid);
|
||||
// let newArr = that.cartList.valid.filter(item => item.attrStatus);
|
||||
// that.isAllSelect = value.length == newArr.length;
|
||||
// that.selectValue = value;
|
||||
// that.switchSelect();
|
||||
// },
|
||||
inArray: function(search, array) {
|
||||
for (let i in array) {
|
||||
if (array[i] == search) {
|
||||
|
@ -677,6 +656,7 @@
|
|||
that.setCartNum(item.id, item.cartNum, function(data) {
|
||||
that.cartList.valid[index] = item;
|
||||
that.switchSelect();
|
||||
that.getCartNum();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -696,6 +676,7 @@
|
|||
that.setCartNum(item.id, item.cartNum, function(data) {
|
||||
that.cartList.valid[index] = item;
|
||||
that.switchSelect();
|
||||
that.getCartNum();
|
||||
});
|
||||
},
|
||||
setCartNum(cartId, cartNum, successCallback) {
|
||||
|
@ -872,8 +853,8 @@
|
|||
} else {
|
||||
that.getCartList();
|
||||
}
|
||||
if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0) {
|
||||
// that.getHostProduct();
|
||||
if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0 && this.hotPage != 1) {
|
||||
that.getHostProduct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,804 +0,0 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class='shoppingCart'>
|
||||
<view class='labelNav acea-row row-around row-middle'>
|
||||
<view class='item'><text class='iconfont icon-xuanzhong'></text>100%正品保证</view>
|
||||
<view class='item'><text class='iconfont icon-xuanzhong'></text>所有商品精挑细选</view>
|
||||
<view class='item'><text class='iconfont icon-xuanzhong'></text>售后无忧</view>
|
||||
</view>
|
||||
<view class='nav acea-row row-between-wrapper'>
|
||||
<view>购物数量 <text class='num font-color'>{{cartCount}}</text></view>
|
||||
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0" class='administrate acea-row row-center-wrapper'
|
||||
@click='manage'>{{ footerswitch ? '管理' : '取消'}}</view>
|
||||
</view>
|
||||
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0">
|
||||
<view class='list'>
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<block v-for="(item,index) in cartList.valid" :key="index">
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<!-- #ifndef MP -->
|
||||
<checkbox :value="(item.id).toString()" :checked="item.checked" :disabled="!item.attrStatus && footerswitch" />
|
||||
<!-- <checkbox :value="(item.id).toString()" :checked="item.checked" /> -->
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<checkbox :value="item.id" :checked="item.checked" :disabled="!item.attrStatus && footerswitch" />
|
||||
<!-- <checkbox :value="item.id" :checked="item.checked" /> -->
|
||||
<!-- #endif -->
|
||||
<navigator :url='"/pages/goods_details/index?id="+item.product_id' hover-class='none' class='picTxt acea-row row-between-wrapper'>
|
||||
<view class='pictrue'>
|
||||
<image v-if="item.productInfo.attrInfo" :src='item.productInfo.attrInfo.image'></image>
|
||||
<image v-else :src='item.productInfo.image'></image>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='line1' :class="item.attrStatus?'':'reColor'">{{item.productInfo.store_name}}</view>
|
||||
<view class='infor line1' v-if="item.productInfo.attrInfo">属性:{{item.productInfo.attrInfo.suk}}</view>
|
||||
<view class='money' v-if="item.attrStatus">¥{{item.truePrice}}</view>
|
||||
<view class="reElection acea-row row-between-wrapper" v-else>
|
||||
<view class="title">请重新选择商品规格</view>
|
||||
<view class="reBnt cart-color acea-row row-center-wrapper" @click.stop="reElection(item)">重选</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='carnum acea-row row-center-wrapper' v-if="item.attrStatus">
|
||||
<view class="reduce" :class="item.numSub ? 'on' : ''" @click.stop='subCart(index)'>-</view>
|
||||
<view class='num'>{{item.cart_num}}</view>
|
||||
<!-- <view class="num">
|
||||
<input type="number" v-model="item.cart_num" @click.stop @input="iptCartNum(index)" @blur="blurInput(index)"/>
|
||||
</view> -->
|
||||
<view class="plus" :class="item.numAdd ? 'on' : ''" @click.stop='addCart(index)'>+</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- <navigator :url='"/pages/goods_details/index?id="+item.product_id' hover-class='none' class='picTxt acea-row row-between-wrapper'>
|
||||
<view class='pictrue'>
|
||||
<image v-if="item.productInfo.attrInfo" :src='item.productInfo.attrInfo.image'></image>
|
||||
<image v-else :src='item.productInfo.image'></image>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='line1'>{{item.productInfo.store_name}}</view>
|
||||
<view class='infor line1' v-if="item.productInfo.attrInfo">属性:{{item.productInfo.attrInfo.suk}}</view>
|
||||
<view class='money'>¥{{item.truePrice}}</view>
|
||||
</view>
|
||||
<view class='carnum acea-row row-center-wrapper'>
|
||||
<view class="reduce" :class="item.numSub ? 'on' : ''" @click.stop='subCart(index)'>-</view>
|
||||
<view class='num'>{{item.cart_num}}</view>
|
||||
<view class="plus" :class="item.numAdd ? 'on' : ''" @click.stop='addCart(index)'>+</view>
|
||||
</view>
|
||||
</navigator> -->
|
||||
</view>
|
||||
</block>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class='invalidGoods' v-if="cartList.invalid.length > 0">
|
||||
<view class='goodsNav acea-row row-between-wrapper'>
|
||||
<view @click='goodsOpen'><text class='iconfont' :class='goodsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text>失效商品</view>
|
||||
<view class='del' @click='unsetCart'><text class='iconfont icon-shanchu1'></text>清空</view>
|
||||
</view>
|
||||
<view class='goodsList' :hidden='goodsHidden'>
|
||||
<block v-for="(item,index) in cartList.invalid" :key='index'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='invalid'>失效</view>
|
||||
<view class='pictrue'>
|
||||
<image v-if="item.productInfo.attrInfo" :src='item.productInfo.attrInfo.image'></image>
|
||||
<image v-else :src='item.productInfo.image'></image>
|
||||
</view>
|
||||
<view class='text acea-row row-column-between'>
|
||||
<view class='line1 name'>{{item.productInfo.store_name}}</view>
|
||||
<view class='infor line1' v-if="item.productInfo.attrInfo">属性:{{item.productInfo.attrInfo.suk}}</view>
|
||||
<view class='acea-row row-between-wrapper'>
|
||||
<!-- <view>¥{{item.truePrice}}</view> -->
|
||||
<view class='end'>该商品已失效</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if="cartList.valid.length&&!loadend">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if="cartList.invalid.length&&loadend">
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loadingInvalid==false'></text>{{loadTitleInvalid}}
|
||||
</view>
|
||||
</view>
|
||||
<view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0">
|
||||
<view class='pictrue'>
|
||||
<image src='../../static/images/noCart.png'></image>
|
||||
</view>
|
||||
<recommend :hostProduct='hostProduct'></recommend>
|
||||
</view>
|
||||
<view style='height:120rpx;'></view>
|
||||
<view class='footer acea-row row-between-wrapper' v-if="cartList.valid.length > 0">
|
||||
<view>
|
||||
<checkbox-group @change="checkboxAllChange">
|
||||
<checkbox value="all" :checked="!!isAllSelect" /><text class='checkAll'>全选 ({{selectValue.length}})</text>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class='money acea-row row-middle' v-if="footerswitch==true">
|
||||
<text class='font-color'>¥{{selectCountPrice}}</text>
|
||||
<form @submit="subOrder" report-submit='true'>
|
||||
<button class='placeOrder bg-color' formType="submit">立即下单</button>
|
||||
</form>
|
||||
</view>
|
||||
<view class='button acea-row row-middle' v-else>
|
||||
<form @submit="subCollect" report-submit='true'>
|
||||
<button class='bnt cart-color' formType="submit">收藏</button>
|
||||
</form>
|
||||
<form @submit="subDel" report-submit='true'>
|
||||
<button class='bnt' formType="submit">删除</button>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getCartList,
|
||||
getCartCounts,
|
||||
changeCartNum,
|
||||
cartDel
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
getProductHot,
|
||||
collectAll
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import recommend from '@/components/recommend';
|
||||
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
recommend,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cartCount: 0,
|
||||
goodsHidden: true,
|
||||
footerswitch: true,
|
||||
hostProduct: [],
|
||||
cartList: {
|
||||
valid: [],
|
||||
invalid: []
|
||||
},
|
||||
isAllSelect: false, //全选
|
||||
selectValue: [], //选中的数据
|
||||
selectCountPrice: 0.00,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
hotScroll:false,
|
||||
hotPage:1,
|
||||
hotLimit:10,
|
||||
|
||||
loading: false,
|
||||
loadend: false,
|
||||
loadTitle: '加载更多', //提示语
|
||||
page: 1,
|
||||
limit: 20,
|
||||
loadingInvalid: false,
|
||||
loadendInvalid: false,
|
||||
loadTitleInvalid: '加载更多', //提示语
|
||||
pageInvalid: 1,
|
||||
limitInvalid: 20,
|
||||
attr: {
|
||||
cartAttr: false,
|
||||
productAttr: [],
|
||||
productSelect: {}
|
||||
},
|
||||
productValue: [], //系统属性
|
||||
storeInfo: {},
|
||||
attrValue: '', //已选属性
|
||||
attrTxt: '请选择', //属性页面提示
|
||||
cartId: 0,
|
||||
product_id: 0
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad: function(options) {
|
||||
let that = this;
|
||||
if (that.isLogin == false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.isAuto = true;
|
||||
that.$set(that, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
if (this.isLogin == true) {
|
||||
this.getHostProduct();
|
||||
this.getCartList();
|
||||
this.getCartNum();
|
||||
this.goodsHidden = true;
|
||||
this.footerswitch = true;
|
||||
this.hostProduct = [];
|
||||
this.hotScroll = false;
|
||||
this.hotPage = 1;
|
||||
this.hotLimit = 10;
|
||||
this.cartList = {
|
||||
valid: [],
|
||||
invalid: []
|
||||
},
|
||||
this.isAllSelect = false; //全选
|
||||
this.selectValue = []; //选中的数据
|
||||
this.selectCountPrice = 0.00;
|
||||
this.cartCount = 0;
|
||||
this.isShowAuth = false;
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 手动输入数量失焦事件
|
||||
*/
|
||||
// inputBlur(index,val) {
|
||||
// if (val <= 1) {
|
||||
// // let index = e.currentTarget.dataset.index;
|
||||
// let item = this.cartList.valid[index];
|
||||
// item.cart_num = 1;
|
||||
// if (item.cart_num) this.setCartNum(item.id, item.cart_num);
|
||||
// this.cartList.valid[index] = item;
|
||||
// this.$set(this.cartList,'valid',this.cartList.valid);
|
||||
// this.switchSelect();
|
||||
// }
|
||||
// },
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
},
|
||||
subDel: function(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
if (selectValue.length > 0)
|
||||
cartDel(selectValue).then(res => {
|
||||
that.getCartList();
|
||||
that.getCartNum();
|
||||
});
|
||||
else
|
||||
return that.$util.Tips({
|
||||
title: '请选择产品'
|
||||
});
|
||||
},
|
||||
getSelectValueProductId: function() {
|
||||
let that = this;
|
||||
let validList = that.cartList.valid;
|
||||
let selectValue = that.selectValue;
|
||||
let productId = [];
|
||||
if (selectValue.length > 0) {
|
||||
for (let index in validList) {
|
||||
if (that.inArray(validList[index].id, selectValue)) {
|
||||
productId.push(validList[index].product_id);
|
||||
}
|
||||
}
|
||||
};
|
||||
return productId;
|
||||
},
|
||||
subCollect: function(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
if (selectValue.length > 0) {
|
||||
let selectValueProductId = that.getSelectValueProductId();
|
||||
collectAll(that.getSelectValueProductId().join(',')).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: res.msg,
|
||||
icon: 'success'
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return that.$util.Tips({
|
||||
title: '请选择产品'
|
||||
});
|
||||
}
|
||||
},
|
||||
subOrder: function(event) {
|
||||
let that = this,
|
||||
selectValue = that.selectValue;
|
||||
if (selectValue.length > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + selectValue.join(',')
|
||||
});
|
||||
} else {
|
||||
return that.$util.Tips({
|
||||
title: '请选择产品'
|
||||
});
|
||||
}
|
||||
},
|
||||
checkboxAllChange: function(event) {
|
||||
let value = event.detail.value;
|
||||
if (value.length > 0) {
|
||||
this.setAllSelectValue(1)
|
||||
} else {
|
||||
this.setAllSelectValue(0)
|
||||
}
|
||||
},
|
||||
setAllSelectValue: function(status) {
|
||||
let that = this;
|
||||
let selectValue = [];
|
||||
let valid = that.cartList.valid;
|
||||
if (valid.length > 0) {
|
||||
for (let index in valid) {
|
||||
if (status == 1) {
|
||||
valid[index].checked = true;
|
||||
selectValue.push(valid[index].id);
|
||||
} else valid[index].checked = false;
|
||||
}
|
||||
that.$set(that.cartList, 'valid', valid);
|
||||
that.selectValue = selectValue;
|
||||
that.switchSelect();
|
||||
}
|
||||
},
|
||||
checkboxChange: function(event) {
|
||||
let that = this;
|
||||
let value = event.detail.value;
|
||||
let valid = that.cartList.valid;
|
||||
for (let index in valid) {
|
||||
if (that.inArray(valid[index].id, value)) valid[index].checked = true;
|
||||
else valid[index].checked = false;
|
||||
}
|
||||
that.$set(that.cartList, 'valid', valid);
|
||||
that.isAllSelect = value.length == that.cartList.valid.length;
|
||||
that.selectValue = value;
|
||||
that.switchSelect();
|
||||
},
|
||||
inArray: function(search, array) {
|
||||
for (let i in array) {
|
||||
if (array[i] == search) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
switchSelect: function() {
|
||||
let that = this;
|
||||
let validList = that.cartList.valid;
|
||||
let selectValue = that.selectValue;
|
||||
let selectCountPrice = 0.00;
|
||||
if (selectValue.length < 1) {
|
||||
that.selectCountPrice = selectCountPrice;
|
||||
} else {
|
||||
for (let index in validList) {
|
||||
if (that.inArray(validList[index].id, selectValue)) {
|
||||
selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index].cart_num, validList[
|
||||
index].truePrice))
|
||||
}
|
||||
}
|
||||
that.selectCountPrice = selectCountPrice;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 购物车手动填写
|
||||
*
|
||||
*/
|
||||
iptCartNum: function (index) {
|
||||
let item = this.cartList.valid[index];
|
||||
if(item.cart_num){
|
||||
this.setCartNum(item.id, item.cart_num);
|
||||
}
|
||||
this.switchSelect();
|
||||
},
|
||||
blurInput:function (index) {
|
||||
let item = this.cartList.valid[index];
|
||||
if(!item.cart_num){
|
||||
item.cart_num = 1;
|
||||
this.$set(this.cartList,'valid',this.cartList.valid)
|
||||
}
|
||||
},
|
||||
subCart: function(index) {
|
||||
let that = this;
|
||||
let status = false;
|
||||
let item = that.cartList.valid[index];
|
||||
item.cart_num = Number(item.cart_num) - 1;
|
||||
if (item.cart_num < 1) status = true;
|
||||
if (item.cart_num <= 1) {
|
||||
item.cart_num = 1;
|
||||
item.numSub = true;
|
||||
} else {
|
||||
item.numSub = false;
|
||||
item.numAdd = false;
|
||||
}
|
||||
if (false == status) {
|
||||
that.setCartNum(item.id, item.cart_num, function(data) {
|
||||
that.cartList.valid[index] = item;
|
||||
that.switchSelect();
|
||||
});
|
||||
}
|
||||
},
|
||||
addCart: function(index) {
|
||||
let that = this;
|
||||
let item = that.cartList.valid[index];
|
||||
item.cart_num = Number(item.cart_num) + 1;
|
||||
let productInfo = item.productInfo;
|
||||
if (productInfo.hasOwnProperty('attrInfo') && item.cart_num >= item.productInfo.attrInfo.stock) {
|
||||
item.cart_num = item.productInfo.attrInfo.stock;
|
||||
item.numAdd = true;
|
||||
item.numSub = false;
|
||||
}else {
|
||||
item.numAdd = false;
|
||||
item.numSub = false;
|
||||
}
|
||||
that.setCartNum(item.id, item.cart_num, function(data) {
|
||||
that.cartList.valid[index] = item;
|
||||
that.switchSelect();
|
||||
});
|
||||
},
|
||||
setCartNum(cartId, cartNum, successCallback) {
|
||||
let that = this;
|
||||
changeCartNum(cartId, cartNum).then(res => {
|
||||
successCallback && successCallback(res.data);
|
||||
});
|
||||
},
|
||||
getCartNum: function() {
|
||||
let that = this;
|
||||
getCartCounts().then(res => {
|
||||
that.cartCount = res.data.count;
|
||||
});
|
||||
},
|
||||
getCartList: function() {
|
||||
let that = this;
|
||||
getCartList().then(res => {
|
||||
let cartList = res.data;
|
||||
let valid = cartList.valid;
|
||||
let numSub = [{
|
||||
numSub: true
|
||||
}, {
|
||||
numSub: false
|
||||
}];
|
||||
let numAdd = [{
|
||||
numAdd: true
|
||||
}, {
|
||||
numAdd: false
|
||||
}],
|
||||
selectValue = [];
|
||||
if (valid.length > 0) {
|
||||
for (let index in valid) {
|
||||
if (valid[index].cart_num == 1) {
|
||||
valid[index].numSub = true;
|
||||
} else {
|
||||
valid[index].numSub = false;
|
||||
}
|
||||
let productInfo = valid[index].productInfo;
|
||||
if (productInfo.hasOwnProperty('attrInfo') && valid[index].cart_num == valid[index].productInfo.attrInfo.stock) {
|
||||
valid[index].numAdd = true;
|
||||
} else if (valid[index].cart_num == valid[index].productInfo.stock) {
|
||||
valid[index].numAdd = true;
|
||||
} else {
|
||||
valid[index].numAdd = false;
|
||||
}
|
||||
valid[index].checked = true;
|
||||
selectValue.push(valid[index].id);
|
||||
}
|
||||
}
|
||||
that.$set(that, 'cartList', cartList);
|
||||
that.goodsHidden = cartList.valid.length <= 0 ? false : true;
|
||||
that.selectValue = selectValue;
|
||||
that.isAllSelect = valid.length == selectValue.length && valid.length;
|
||||
that.switchSelect();
|
||||
});
|
||||
},
|
||||
getHostProduct: function() {
|
||||
let that = this;
|
||||
if(that.hotScroll) return
|
||||
getProductHot(
|
||||
that.hotPage,
|
||||
that.hotLimit,
|
||||
).then(res => {
|
||||
that.hotPage++
|
||||
that.hotScroll = res.data.list.length<that.hotLimit
|
||||
that.hostProduct = that.hostProduct.concat(res.data.list)
|
||||
});
|
||||
},
|
||||
goodsOpen: function() {
|
||||
let that = this;
|
||||
that.goodsHidden = !that.goodsHidden;
|
||||
},
|
||||
manage: function() {
|
||||
let that = this;
|
||||
that.footerswitch = !that.footerswitch;
|
||||
},
|
||||
unsetCart: function() {
|
||||
let that = this,
|
||||
ids = [];
|
||||
for (let i = 0, len = that.cartList.invalid.length; i < len; i++) {
|
||||
ids.push(that.cartList.invalid[i].id);
|
||||
}
|
||||
cartDel(ids).then(res => {
|
||||
that.$util.Tips({
|
||||
title: '清除成功'
|
||||
});
|
||||
that.$set(that.cartList, 'invalid', []);
|
||||
}).catch(res => {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getHostProduct();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shoppingCart .labelNav {
|
||||
height: 76rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 22rpx;
|
||||
color: #8c8c8c;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #f5f5f5;
|
||||
z-index: 5;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.shoppingCart .labelNav .item .iconfont {
|
||||
font-size: 25rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .nav {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background-color: #fff;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
z-index: 5;
|
||||
top: 76rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .nav .administrate {
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
width: 110rpx;
|
||||
height: 46rpx;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid #868686;
|
||||
}
|
||||
|
||||
.shoppingCart .noCart {
|
||||
margin-top: 171rpx;
|
||||
background-color: #fff;
|
||||
padding-top: 0.1rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .noCart .pictrue {
|
||||
width: 414rpx;
|
||||
height: 336rpx;
|
||||
margin: 78rpx auto 56rpx auto;
|
||||
}
|
||||
|
||||
.shoppingCart .noCart .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.shoppingCart .list {
|
||||
margin-top: 171rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item {
|
||||
padding: 25rpx 30rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt {
|
||||
width: 627rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .pictrue {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .text {
|
||||
width: 444rpx;
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .text .infor {
|
||||
font-size: 24rpx;
|
||||
color: #868686;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .text .money {
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum {
|
||||
height: 47rpx;
|
||||
position: absolute;
|
||||
bottom: 7rpx;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum view {
|
||||
border: 1rpx solid #a4a4a4;
|
||||
width: 66rpx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: #a4a4a4;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum .reduce {
|
||||
border-right: 0;
|
||||
border-radius: 3rpx 0 0 3rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum .reduce.on {
|
||||
border-color: #e3e3e3;
|
||||
color: #dedede;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum .plus {
|
||||
border-left: 0;
|
||||
border-radius: 0 3rpx 3rpx 0;
|
||||
}
|
||||
|
||||
.shoppingCart .list .item .picTxt .carnum .num {
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsNav {
|
||||
width: 100%;
|
||||
height: 66rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsNav .iconfont {
|
||||
color: #424242;
|
||||
font-size: 28rpx;
|
||||
margin-right: 17rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsNav .del {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsNav .del .icon-shanchu1 {
|
||||
color: #999;
|
||||
font-size: 33rpx;
|
||||
vertical-align: -2rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item {
|
||||
padding: 20rpx 30rpx;
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item .invalid {
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
width: 70rpx;
|
||||
height: 36rpx;
|
||||
background-color: #aaa;
|
||||
border-radius: 3rpx;
|
||||
text-align: center;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item .pictrue {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item .text {
|
||||
width: 433rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
height: 140rpx;
|
||||
}
|
||||
.shoppingCart .invalidGoods .goodsList .item .text .name{width:100%;}
|
||||
.shoppingCart .invalidGoods .goodsList .item .text .infor {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .invalidGoods .goodsList .item .text .end {
|
||||
font-size: 26rpx;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.shoppingCart .footer {
|
||||
z-index:9;
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
background-color: #fafafa;
|
||||
position: fixed;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-top: 1rpx solid #eee;
|
||||
//
|
||||
bottom: 0;
|
||||
//
|
||||
// #ifndef MP
|
||||
bottom: 50px;
|
||||
// #endif
|
||||
}
|
||||
|
||||
.shoppingCart .footer .checkAll {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
// .shoppingCart .footer checkbox .wx-checkbox-input{background-color:#fafafa;}
|
||||
.shoppingCart .footer .money {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .footer .placeOrder {
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
width: 226rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
margin-left: 22rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .footer .button .bnt {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
border-radius: 50rpx;
|
||||
border: 1px solid #999;
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.shoppingCart .footer .button form~form {
|
||||
margin-left: 17rpx;
|
||||
}
|
||||
</style>
|
|
@ -226,7 +226,7 @@
|
|||
</view>
|
||||
<home></home>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
|
||||
</view>
|
||||
|
@ -658,7 +658,8 @@
|
|||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
id: 0, //订单id
|
||||
uniId: ''
|
||||
uniId: '',
|
||||
utils: this.$util,
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin', 'chatUrl']),
|
||||
|
@ -676,13 +677,7 @@
|
|||
this.getOrderInfo();
|
||||
this.getUserInfo();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onHide: function() {
|
||||
|
@ -835,7 +830,6 @@
|
|||
newCartInfo.push(item.info);
|
||||
});
|
||||
that.$set(that, 'cartInfo', newCartInfo);
|
||||
console.log(that.cartInfo)
|
||||
if (res.data.refundStatus != 0) {
|
||||
that.isGoodsReturn = true;
|
||||
};
|
||||
|
@ -961,7 +955,7 @@
|
|||
*/
|
||||
delOrder: function() {
|
||||
let that = this;
|
||||
orderDel(this.order_id).then(res => {
|
||||
orderDel(this.id).then(res => {
|
||||
return that.$util.Tips({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none' v-else>返回首页</button>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -88,6 +88,16 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getOrderPayInfo();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
if (!options.order_id) return this.$util.Tips({
|
||||
title: '缺少参数无法查看订单支付状态'
|
||||
|
@ -101,13 +111,7 @@
|
|||
if (this.isLogin) {
|
||||
this.getOrderPayInfo();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -12,6 +12,11 @@
|
|||
请点击授权
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="name" v-if="!userInfo.uid && isWeixin" @tap="openAuto">
|
||||
请点击授权
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="name" v-if="userInfo.uid">
|
||||
{{userInfo.nickname}}
|
||||
<view class="vip" v-if="userInfo.vip">
|
||||
|
@ -20,7 +25,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="num" v-if="userInfo.phone" @click="goEdit()">
|
||||
<view class="num-txt">ID:{{userInfo.uid}}</view>
|
||||
<view class="num-txt">{{userInfo.phone}}</view>
|
||||
<view class="icon">
|
||||
<image src="/static/images/edit.png" mode=""></image>
|
||||
</view>
|
||||
|
@ -71,9 +76,7 @@
|
|||
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
|
||||
<block v-for="(item,index) in imgUrls" :key="index">
|
||||
<swiper-item>
|
||||
<navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
|
||||
<image :src="item.pic" class="slide-image"></image>
|
||||
</navigator>
|
||||
<image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
@ -92,7 +95,7 @@
|
|||
<!-- #ifdef H5 -->
|
||||
<view class="item" @click="kefuClick">
|
||||
<view class="left">
|
||||
<image src="/static/images/user_menu08.png"></image>
|
||||
<image :src="servicePic"></image>
|
||||
<text>联系客服</text>
|
||||
</view>
|
||||
<view class="iconfont icon-xiangyou"></view>
|
||||
|
@ -101,7 +104,7 @@
|
|||
<!-- #ifdef MP -->
|
||||
<button class="item" open-type='contact' hover-class='none'>
|
||||
<view class="left">
|
||||
<image src="/static/images/user_menu08.png"></image>
|
||||
<image :src="servicePic"></image>
|
||||
<text>联系客服</text>
|
||||
</view>
|
||||
<view class="iconfont icon-xiangyou"></view>
|
||||
|
@ -110,7 +113,7 @@
|
|||
</view>
|
||||
<img src="/static/images/support.png" alt="" class='support'>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -129,6 +132,9 @@
|
|||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef H5
|
||||
import Auth from '@/libs/wechat';
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
|
@ -184,12 +190,22 @@
|
|||
orderStatusNum: {},
|
||||
userInfo: {},
|
||||
MyMenus: [],
|
||||
wechatUrl: []
|
||||
wechatUrl: [],
|
||||
servicePic: '',
|
||||
// #ifdef H5
|
||||
isWeixin: Auth.isWeixin()
|
||||
//#endif
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let that = this;
|
||||
that.$set(that, 'MyMenus', app.globalData.MyMenus);
|
||||
console.log('user页面',that.isLogin)
|
||||
if (that.isLogin == false) {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin()
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
let that = this;
|
||||
|
@ -199,12 +215,8 @@
|
|||
// this.setVisit();
|
||||
this.getOrderData();
|
||||
}else{
|
||||
// #ifdef H5 || APP-PLUS
|
||||
if (that.isLogin == false) {
|
||||
toLogin();
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 记录会员访问
|
||||
|
@ -213,11 +225,11 @@
|
|||
// url:'/pages/user/index'
|
||||
// }).then(res=>{})
|
||||
// },
|
||||
navito(e){
|
||||
window.location.href = 'https://' + e;
|
||||
},
|
||||
kefuClick(){
|
||||
location.href = this.wechatUrl[0].wap_url
|
||||
// return this.$util.Tips({
|
||||
// title: '客服功能正在开发中......'
|
||||
// });
|
||||
location.href = this.wechatUrl[0].wap_url;
|
||||
},
|
||||
getOrderData(){
|
||||
let that = this;
|
||||
|
@ -246,8 +258,8 @@
|
|||
},
|
||||
// 打开授权
|
||||
openAuto() {
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true
|
||||
console.log('点击事件','lala')
|
||||
toLogin();
|
||||
},
|
||||
// 授权回调
|
||||
onLoadFun() {
|
||||
|
@ -277,6 +289,7 @@
|
|||
* 获取个人用户信息
|
||||
*/
|
||||
getUserInfo: function() {
|
||||
const _app = getApp();
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.userInfo = res.data;
|
||||
|
@ -292,22 +305,27 @@
|
|||
if (this.MyMenus.length) return;
|
||||
getMenuList().then(res => {
|
||||
that.$set(that, 'MyMenus', res.data.routine_my_menus);
|
||||
// location.pathname.indexOf('auth') !== -1
|
||||
// console.log( res.data.routine_my_menus.filter( item => {
|
||||
// if( item.url.indexOf('service') !== -1 ) return item.wap_url
|
||||
// }))
|
||||
this.wechatUrl = res.data.routine_my_menus.filter((item) => {
|
||||
that.wechatUrl = res.data.routine_my_menus.filter((item) => {
|
||||
return item.url.indexOf('service') !== -1
|
||||
})
|
||||
console.log(this.wechatUrl)
|
||||
this.imgUrls = res.data.routine_my_banner
|
||||
res.data.routine_my_menus.map((item) => {
|
||||
if(item.url.indexOf('service') !==-1) that.servicePic = item.pic
|
||||
})
|
||||
that.imgUrls = res.data.routine_my_banner
|
||||
});
|
||||
},
|
||||
// 编辑页面
|
||||
goEdit() {
|
||||
if (this.isLogin == false) {
|
||||
toLogin();
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/user_info/index'
|
||||
})
|
||||
}
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/users/user_info/index'
|
||||
// })
|
||||
},
|
||||
// 签到
|
||||
goSignIn() {
|
||||
|
@ -391,13 +409,12 @@
|
|||
.vip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 36rpx;
|
||||
padding: 0 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-radius: 18px;
|
||||
font-size: 20rpx;
|
||||
margin-left: 12rpx;
|
||||
margin-top: 2rpx;
|
||||
// margin-top: 2rpx;
|
||||
|
||||
image {
|
||||
width: 27rpx;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -74,18 +74,23 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -92,6 +92,16 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getOrderProduct();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.unique || !options.uni || !options.id) return this.$util.Tips({
|
||||
title: '缺少参数'
|
||||
|
@ -106,13 +116,7 @@
|
|||
if (this.isLogin) {
|
||||
this.getOrderProduct();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -98,7 +98,9 @@
|
|||
that.$set(that,'reply',that.reply);
|
||||
that.loading = false;
|
||||
that.loadend = loadend;
|
||||
if(that.reply.length){
|
||||
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
|
||||
}
|
||||
that.page = that.page + 1;
|
||||
}).catch(err => {
|
||||
that.loading = false,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<!-- #ifdef H5 -->
|
||||
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="store-phone" @click="call(item.phone)"><text class="iconfont icon-dadianhua01"></text></view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -78,10 +78,27 @@
|
|||
},
|
||||
orderInfo: {},
|
||||
expressList: [],
|
||||
hostProduct: []
|
||||
hostProduct: [],
|
||||
loading: false,
|
||||
goodScroll: true,
|
||||
params: { //精品推荐分页
|
||||
page: 1,
|
||||
limit: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getExpress();
|
||||
this.get_host_product();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
|
||||
this.orderId = options.orderId;
|
||||
|
@ -89,13 +106,7 @@
|
|||
this.getExpress();
|
||||
this.get_host_product();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onReady: function() {
|
||||
|
@ -133,13 +144,43 @@
|
|||
/**
|
||||
* 获取我的推荐
|
||||
*/
|
||||
// getGroomList(onloadH) {
|
||||
// this.loading = true
|
||||
// if (!this.goodScroll) return
|
||||
// if (onloadH) {
|
||||
// this.iSshowH = true
|
||||
// }
|
||||
// getGroomList(type, this.params).then(({
|
||||
// data
|
||||
// }) => {
|
||||
// this.iSshowH = false
|
||||
// this.loading = false
|
||||
// this.goodScroll = data.list.length >= this.params.limit
|
||||
// this.params.page++
|
||||
// this.tempArr = this.tempArr.concat(data.list)
|
||||
// })
|
||||
// }
|
||||
get_host_product: function () {
|
||||
this.loading = true
|
||||
if (!this.goodScroll) return
|
||||
let that = this;
|
||||
getProductHot().then(function (res) {
|
||||
that.$set(that,'hostProduct',res.data.list);
|
||||
getProductHot(that.params.page,that.params.limit).then(function (res) {
|
||||
//this.iSshowH = false
|
||||
that.loading = false
|
||||
that.goodScroll = res.data.list.length >= that.params.limit
|
||||
that.params.page++
|
||||
that.hostProduct = that.hostProduct.concat(res.data.list)
|
||||
// that.$set(that,'hostProduct',res.data.list);
|
||||
});
|
||||
},
|
||||
},
|
||||
// 滚动到底部
|
||||
onReachBottom() {
|
||||
|
||||
if (this.params.page != 1) {
|
||||
this.get_host_product();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -93,6 +93,17 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function (options) {
|
||||
if (!options.orderId) return this.$util.Tips({title:'缺少订单id,无法退款'},{tab:3,url:1});
|
||||
this.orderId = options.orderId;
|
||||
|
@ -100,13 +111,7 @@
|
|||
this.getOrderInfo();
|
||||
this.getRefundReason();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -1,47 +1,36 @@
|
|||
<template>
|
||||
<div class="register absolute">
|
||||
<div class="login-wrapper">
|
||||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
<image src="/static/images/logo2.png" v-else />
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
|
||||
:key="index">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 1">
|
||||
<div class="list" v-if="current !== 1">
|
||||
<form @submit.prevent="submit">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
||||
<span class="iconfont icon-wenti"></span>忘记密码
|
||||
</navigator> -->
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 0">
|
||||
<div class="list" v-if="current !== 0 || appLoginStatus || appleLoginStatus">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
|
@ -50,59 +39,44 @@
|
|||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
|
||||
<div class="tip">
|
||||
<div :hidden="current !== 1">
|
||||
没有账号?
|
||||
<span @click="current = 0" class="font-color-red">快速登录</span>
|
||||
<div class="logon" @click="loginMobile" v-if="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" v-if="current === 0">登录</div>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<div class="tips">
|
||||
<div v-if="current==0" @click="current = 1">快速登录</div>
|
||||
<div v-if="current==1" @click="current = 0">账号登录</div>
|
||||
</div>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
|
||||
<view class="hds">
|
||||
<span class="line"></span>
|
||||
<p>其他方式登录</p>
|
||||
<span class="line"></span>
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<view class="btn wx" @click="wxLogin">
|
||||
<span class="iconfont icon-s-weixindenglu1"></span>
|
||||
</view>
|
||||
<view class="btn mima" v-if="current == 1" @click="current =0">
|
||||
<span class="iconfont icon-s-mimadenglu1"></span>
|
||||
</view>
|
||||
<view class="btn yanzheng" v-if="current == 0" @click="current =1">
|
||||
<span class="iconfont icon-s-yanzhengmadenglu1"></span>
|
||||
</view>
|
||||
<view class="apple-btn" @click="appleLogin" v-if="appleShow">
|
||||
<view class="iconfont icon-s-pingguo"></view>通过Apple登录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="whiteBg" v-else>
|
||||
<div class="title">注册账号</div>
|
||||
<div class="list">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_1.png"></image>
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="register">注册</div>
|
||||
<div class="tip">
|
||||
已有账号?
|
||||
<span @click="formItem = 1" class="font-color-red">立即登录</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -150,7 +124,12 @@
|
|||
keyCode: "",
|
||||
codeUrl: "",
|
||||
codeVal: "",
|
||||
isShowCode: false
|
||||
isShowCode: false,
|
||||
appLoginStatus: false, // 微信登录强制绑定手机号码状态
|
||||
appUserInfo: null, // 微信登录保存的用户信息
|
||||
appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
|
||||
appleUserInfo: null,
|
||||
appleShow: false // 苹果登录版本必须要求ios13以上的
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
|
@ -167,6 +146,138 @@
|
|||
this.getLogoImage();
|
||||
},
|
||||
methods: {
|
||||
// 苹果登录
|
||||
appleLogin() {
|
||||
let self = this
|
||||
this.account = ''
|
||||
this.captcha = ''
|
||||
uni.showLoading({
|
||||
title: '登录中'
|
||||
})
|
||||
uni.login({
|
||||
provider: 'apple',
|
||||
timeout: 10000,
|
||||
success(loginRes) {
|
||||
console.log(loginRes, 'loginRes')
|
||||
uni.getUserInfo({
|
||||
provider: 'apple',
|
||||
success: function(infoRes) {
|
||||
console.log(infoRes.userInfo, 'yyyy')
|
||||
self.appleUserInfo = infoRes.userInfo
|
||||
self.appleLoginApi()
|
||||
|
||||
console.log(self.$store);
|
||||
console.log(infoRes.userInfo);
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
fail(error) {
|
||||
console.log(error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 苹果登录Api
|
||||
appleLoginApi() {
|
||||
let self = this
|
||||
appleLogin({
|
||||
openId: self.appleUserInfo.openId,
|
||||
email: self.appleUserInfo.email || '',
|
||||
phone: this.account,
|
||||
captcha: this.captcha
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data.isbind) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请绑定手机号后,继续操作',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
self.current = 1
|
||||
self.appleLoginStatus = true
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.$store.commit("LOGIN", {
|
||||
'token': data.token,
|
||||
'time': data.expires_time - self.$Cache.time()
|
||||
});
|
||||
let backUrl = self.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
self.$Cache.clear(BACK_URL);
|
||||
self.$store.commit("SETUID", data.userInfo.uid);
|
||||
uni.reLaunch({
|
||||
url: backUrl
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `错误信息${error}`,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// App微信登录
|
||||
wxLogin() {
|
||||
let self = this
|
||||
this.account = ''
|
||||
this.captcha = ''
|
||||
uni.showLoading({
|
||||
title: '登录中'
|
||||
})
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(loginRes) {
|
||||
// 获取用户信息
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: function(infoRes) {
|
||||
console.log(infoRes.userInfo, 'yyyy')
|
||||
self.appUserInfo = infoRes.userInfo
|
||||
self.wxLoginApi()
|
||||
|
||||
console.log(self.$store);
|
||||
console.log(infoRes.userInfo);
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
title: '获取用户信息失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
title: '登录失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
again() {
|
||||
this.codeUrl =
|
||||
VUE_APP_API_URL +
|
||||
|
@ -221,8 +332,9 @@
|
|||
});
|
||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
// getUserInfo().then(res => {
|
||||
that.$store.commit("SETUID", res.data.user.uid);
|
||||
getUserInfo().then(res => {
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
|
||||
'/pages/user/index') {
|
||||
|
||||
|
@ -231,11 +343,12 @@
|
|||
});
|
||||
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
uni.navigateBack()
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// });
|
||||
}
|
||||
// })
|
||||
})
|
||||
})
|
||||
.catch(res => {
|
||||
that.$util.Tips({
|
||||
|
@ -304,7 +417,7 @@
|
|||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||
// that.isShowCode = true;
|
||||
// }
|
||||
that.$util.Tips({title:res});
|
||||
that.$util.Tips({title:res.message});
|
||||
});
|
||||
},
|
||||
navTap: function(index) {
|
||||
|
@ -324,7 +437,7 @@
|
|||
loginH5({
|
||||
account: that.account,
|
||||
password: that.password,
|
||||
spread_spid: that.$Cache.get("spread")
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
|
@ -337,6 +450,7 @@
|
|||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
getUserInfo().then(res => {
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
|
||||
uni.switchTab({
|
||||
|
@ -347,11 +461,7 @@
|
|||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
}).catch(e => {
|
||||
that.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
that.$util.Tips({
|
||||
|
@ -362,7 +472,81 @@
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.appLogin {
|
||||
margin-top: 60rpx;
|
||||
|
||||
.hds {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
color: #B4B4B4;
|
||||
|
||||
.line {
|
||||
width: 68rpx;
|
||||
height: 1rpx;
|
||||
background: #CCCCCC;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 68rpx;
|
||||
height: 68rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.apple-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 246rpx;
|
||||
height: 66rpx;
|
||||
margin-left: 30rpx;
|
||||
background: #EAEAEA;
|
||||
border-radius: 34rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
.icon-s-pingguo {
|
||||
color: #333;
|
||||
margin-right: 10rpx;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.wx {
|
||||
margin-right: 30rpx;
|
||||
background-color: #61C64F;
|
||||
}
|
||||
|
||||
.mima {
|
||||
background-color: #28B3E9;
|
||||
}
|
||||
|
||||
.yanzheng {
|
||||
background-color: #F89C23;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -371,6 +555,67 @@
|
|||
.acea-row.row-middle {
|
||||
input {
|
||||
margin-left: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.login-wrapper{
|
||||
padding: 30rpx;
|
||||
.shading{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
margin-top: 200rpx;
|
||||
image{
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
}
|
||||
.whiteBg{
|
||||
margin-top: 100rpx;
|
||||
.list{
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
.item{
|
||||
border-bottom: 1px solid #F0F0F0;
|
||||
background: #fff;
|
||||
.row-middle{
|
||||
position: relative;
|
||||
padding: 30rpx 45rpx;
|
||||
input{
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.code{
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
color: #E93323;
|
||||
font-size: 26rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.logon{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
margin-top: 100rpx;
|
||||
background-color: $theme-color;
|
||||
border-radius: 120rpx;
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.tips{
|
||||
margin:30rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,372 +0,0 @@
|
|||
<template>
|
||||
<div class="register absolute">
|
||||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
<div class="title acea-row row-center-wrapper">
|
||||
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
|
||||
:key="index">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 1">
|
||||
<form @submit.prevent="submit">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
||||
<span class="iconfont icon-wenti"></span>忘记密码
|
||||
</navigator> -->
|
||||
</div>
|
||||
<div class="list" :hidden="current !== 0">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
|
||||
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
|
||||
<div class="tip">
|
||||
<div :hidden="current !== 1">
|
||||
没有账号?
|
||||
<span @click="current = 0" class="font-color-red">快速登录</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="whiteBg" v-else>
|
||||
<div class="title">注册账号</div>
|
||||
<div class="list">
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/phone_1.png"></image>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
||||
{{ text }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_1.png"></image>
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" v-if="isShowCode">
|
||||
<div class="acea-row row-middle">
|
||||
<image src="/static/images/code_2.png"></image>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
|
||||
<div class="code" @click="again"><img :src="codeUrl" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="logon" @click="register">注册</div>
|
||||
<div class="tip">
|
||||
已有账号?
|
||||
<span @click="formItem = 1" class="font-color-red">立即登录</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import {
|
||||
loginH5,
|
||||
loginMobile,
|
||||
registerVerify,
|
||||
register,
|
||||
// getCodeApi,
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
import attrs, {
|
||||
required,
|
||||
alpha_num,
|
||||
chs_phone
|
||||
} from "@/utils/validate";
|
||||
import {
|
||||
validatorDefaultCatch
|
||||
} from "@/utils/dialog";
|
||||
import {
|
||||
getLogo
|
||||
} from "@/api/public";
|
||||
import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/utils";
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
mixins: [sendVerifyCode],
|
||||
data: function() {
|
||||
return {
|
||||
navList: ["快速登录", "账号登录"],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
formItem: 1,
|
||||
type: "login",
|
||||
logoUrl: "",
|
||||
keyCode: "",
|
||||
codeUrl: "",
|
||||
codeVal: "",
|
||||
isShowCode: false
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
formItem:function(nval,oVal){
|
||||
if(nval == 1){
|
||||
this.type = 'login'
|
||||
}else{
|
||||
this.type = 'register'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.getCode();
|
||||
this.getLogoImage();
|
||||
},
|
||||
methods: {
|
||||
again() {
|
||||
this.codeUrl =
|
||||
VUE_APP_API_URL +
|
||||
"/sms_captcha?" +
|
||||
"key=" +
|
||||
this.keyCode +
|
||||
Date.parse(new Date());
|
||||
},
|
||||
getCode() {
|
||||
let that = this
|
||||
// getCodeApi()
|
||||
// .then(res => {
|
||||
// that.keyCode = res.data.key;
|
||||
// })
|
||||
// .catch(res => {
|
||||
// that.$util.Tips({
|
||||
// title: res
|
||||
// });
|
||||
// });
|
||||
},
|
||||
async getLogoImage() {
|
||||
let that = this;
|
||||
getLogo().then(res => {
|
||||
that.logoUrl = res.data.logoUrl;
|
||||
});
|
||||
},
|
||||
async loginMobile() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (!that.captcha) return that.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||
title: '请输入正确的验证码'
|
||||
});
|
||||
loginMobile({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
let data = res.data;
|
||||
let newTime = Math.round(new Date() / 1000);
|
||||
that.$store.commit("LOGIN", {
|
||||
'token': data.token
|
||||
// 'time': dayjs(data.expiresTime) - newTime
|
||||
});
|
||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
// getUserInfo().then(res => {
|
||||
that.$store.commit("SETUID", res.data.user.uid);
|
||||
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
|
||||
'/pages/user/index') {
|
||||
|
||||
uni.switchTab({
|
||||
url: backUrl
|
||||
});
|
||||
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
// })
|
||||
})
|
||||
.catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
async register() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (!that.captcha) return that.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||
title: '请输入正确的验证码'
|
||||
});
|
||||
if (!that.password) return that.$util.Tips({
|
||||
title: '请填写密码'
|
||||
});
|
||||
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
|
||||
title: '您输入的密码过于简单'
|
||||
});
|
||||
register({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
that.formItem = 1;
|
||||
})
|
||||
.catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
async code() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写手机号码'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (that.formItem == 2) that.type = "register";
|
||||
// phone: that.account
|
||||
// type: that.type,
|
||||
// key: that.keyCode,
|
||||
// code: that.codeVal
|
||||
await registerVerify(that.account)
|
||||
.then(res => {
|
||||
that.$util.Tips({title:res.message});
|
||||
that.sendCode();
|
||||
})
|
||||
.catch(res => {
|
||||
// if (res.data.status === 402) {
|
||||
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
|
||||
// that.isShowCode = true;
|
||||
// }
|
||||
that.$util.Tips({title:res.message});
|
||||
});
|
||||
},
|
||||
navTap: function(index) {
|
||||
this.current = index;
|
||||
},
|
||||
async submit() {
|
||||
let that = this;
|
||||
if (!that.account) return that.$util.Tips({
|
||||
title: '请填写账号'
|
||||
});
|
||||
if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({
|
||||
title: '请输入正确的账号'
|
||||
});
|
||||
if (!that.password) return that.$util.Tips({
|
||||
title: '请填写密码'
|
||||
});
|
||||
loginH5({
|
||||
account: that.account,
|
||||
password: that.password,
|
||||
spread: that.$Cache.get("spread")
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
// let newTime = Math.round(new Date() / 1000);
|
||||
that.$store.commit("LOGIN", {
|
||||
'token': data.token
|
||||
// 'time': dayjs(data.expiresTime) - newTime
|
||||
});
|
||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||
that.$Cache.clear(BACK_URL);
|
||||
getUserInfo().then(res => {
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
|
||||
uni.switchTab({
|
||||
url: backUrl
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(e => {
|
||||
that.$util.Tips({
|
||||
title: e
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.acea-row.row-middle {
|
||||
input {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -142,7 +142,7 @@
|
|||
<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address' :pagesUrl="pagesUrl"
|
||||
@OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -280,6 +280,17 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getaddressInfo();
|
||||
this.getConfirm();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
// #ifdef H5
|
||||
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
||||
|
@ -310,13 +321,7 @@
|
|||
//调用子页面方法授权后执行获取地址列表
|
||||
this.$nextTick(function() {})
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
|
||||
|
@ -173,13 +173,7 @@
|
|||
this.getOrderList();
|
||||
this.getUserInfo();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -119,13 +119,7 @@
|
|||
if (this.isLogin) {
|
||||
this.userSpreadNewList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -92,13 +92,7 @@
|
|||
if (this.isLogin) {
|
||||
this.getRecordOrderList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -10,21 +10,21 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="rank acea-row row-bottom row-around">
|
||||
<view class="item" v-if="Two.uid">
|
||||
<view class="item" v-show="Two.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="Two.avatar"></image>
|
||||
</view>
|
||||
<view class="name line1">{{Two.nickname}}</view>
|
||||
<view class="num">{{Two.spreadCount}}人</view>
|
||||
</view>
|
||||
<view class="item" v-if="One.uid">
|
||||
<view class="item" v-show="One.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="One.avatar"></image>
|
||||
</view>
|
||||
<view class="name line1">{{One.nickname}}</view>
|
||||
<view class="num">{{One.spreadCount}}人</view>
|
||||
</view>
|
||||
<view class="item" v-if="Three.uid">
|
||||
<view class="item" v-show="Three.uid">
|
||||
<view class="pictrue">
|
||||
<image :src="Three.avatar"></image>
|
||||
</view>
|
||||
|
@ -48,7 +48,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -93,17 +93,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getRanklist();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getRanklist();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
// onShow: function () {
|
||||
|
|
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 17 KiB |
|
@ -43,7 +43,7 @@
|
|||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -102,6 +102,17 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserAddress();
|
||||
this.getCityList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (this.isLogin) {
|
||||
this.cartId = options.cartId || '';
|
||||
|
@ -120,13 +131,7 @@
|
|||
// this.initialize();
|
||||
// }
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -1,537 +0,0 @@
|
|||
<template>
|
||||
<view>
|
||||
<form @submit="formSubmit" report-submit='true'>
|
||||
<view class='addAddress'>
|
||||
<view class='list'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>姓名</view>
|
||||
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name" placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>联系电话</view>
|
||||
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone' placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>所在地区</view>
|
||||
<view class="address">
|
||||
<picker mode="multiSelector" @change="bindRegionChange" @columnchange="bindMultiPickerColumnChange" :value="valueRegion"
|
||||
:range="multiArray">
|
||||
<view class='acea-row'>
|
||||
<view class="picker">{{region[0]}},{{region[1]}},{{region[2]}}</view>
|
||||
<view class='iconfont icon-dizhi font-color'></view>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='name'>详细地址</view>
|
||||
<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder' :value='userAddress.detail'></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class='default acea-row row-middle'>
|
||||
<checkbox-group @change='ChangeIsDefault'>
|
||||
<checkbox :checked="userAddress.is_default ? true : false" />设置为默认地址</checkbox-group>
|
||||
</view>
|
||||
|
||||
<button class='keepBnt bg-color' form-type="submit">立即保存</button>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入微信地址</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !id" @click="getAddress">导入微信地址</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
editAddress,
|
||||
getAddressDetail
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
getCity
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import wPicker from "@/components/wPicker/w-picker.vue";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import home from '@/components/home';
|
||||
import city from '@/utils/city';
|
||||
export default {
|
||||
components: {
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
// #endif
|
||||
home
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
regionDval: ['浙江省', '杭州市', '滨江区'],
|
||||
cartId: '', //购物车id
|
||||
pinkId: 0, //拼团id
|
||||
couponId: 0, //优惠券id
|
||||
id: 0, //地址id
|
||||
userAddress: {
|
||||
is_default: false
|
||||
}, //地址详情
|
||||
region: ['省', '市', '区'],
|
||||
valueRegion: [0, 0, 0],
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
district: [],
|
||||
multiArray: [],
|
||||
multiIndex: [0, 0, 0],
|
||||
cityId: 0,
|
||||
defaultRegion: ['广东省', '广州市', '番禺区'],
|
||||
defaultRegionCode: '440113'
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad(options) {
|
||||
if (this.isLogin) {
|
||||
this.cartId = options.cartId || '';
|
||||
this.pinkId = options.pinkId || 0;
|
||||
this.couponId = options.couponId || 0;
|
||||
this.id = options.id || 0;
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.id ? '修改地址' : '添加地址'
|
||||
})
|
||||
this.getUserAddress();
|
||||
this.getCityList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 回去地址数据
|
||||
getCityList: function() {
|
||||
let that = this;
|
||||
getCity().then(res => {
|
||||
this.district = res.data
|
||||
that.initialize();
|
||||
})
|
||||
},
|
||||
initialize: function() {
|
||||
let that = this,
|
||||
province = [],
|
||||
city = [],
|
||||
area = [];
|
||||
if (that.district.length) {
|
||||
let cityChildren = that.district[0].c || [];
|
||||
let areaChildren = cityChildren.length ? (cityChildren[0].c || []) : [];
|
||||
that.district.forEach(function(item) {
|
||||
province.push(item.n);
|
||||
});
|
||||
cityChildren.forEach(function(item) {
|
||||
city.push(item.n);
|
||||
});
|
||||
areaChildren.forEach(function(item) {
|
||||
area.push(item.n);
|
||||
});
|
||||
this.multiArray = [province, city, area]
|
||||
}
|
||||
},
|
||||
bindRegionChange: function(e) {
|
||||
let multiIndex = this.multiIndex,
|
||||
province = this.district[multiIndex[0]] || {
|
||||
c: []
|
||||
},
|
||||
city = province.c[multiIndex[1]] || {
|
||||
v: 0
|
||||
},
|
||||
multiArray = this.multiArray,
|
||||
value = e.detail.value;
|
||||
|
||||
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
|
||||
// this.$set(this.region,0,multiArray[0][value[0]]);
|
||||
// this.$set(this.region,1,multiArray[1][value[1]]);
|
||||
// this.$set(this.region,2,multiArray[2][value[2]]);
|
||||
this.cityId = city.v
|
||||
this.valueRegion = [0, 0, 0]
|
||||
this.initialize();
|
||||
},
|
||||
bindMultiPickerColumnChange: function(e) {
|
||||
let that = this,
|
||||
column = e.detail.column,
|
||||
value = e.detail.value,
|
||||
currentCity = this.district[value] || {
|
||||
c: []
|
||||
},
|
||||
multiArray = that.multiArray,
|
||||
multiIndex = that.multiIndex;
|
||||
multiIndex[column] = value;
|
||||
switch (column) {
|
||||
case 0:
|
||||
let areaList = currentCity.c[0] || {
|
||||
c: []
|
||||
};
|
||||
multiArray[1] = currentCity.c.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
multiArray[2] = areaList.c.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
let cityList = that.district[multiIndex[0]].c[multiIndex[1]].c || [];
|
||||
multiArray[2] = cityList.map((item) => {
|
||||
return item.n;
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
|
||||
break;
|
||||
}
|
||||
// #ifdef MP
|
||||
this.$set(this.multiArray, 0, multiArray[0]);
|
||||
this.$set(this.multiArray, 1, multiArray[1]);
|
||||
this.$set(this.multiArray, 2, multiArray[2]);
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.multiArray = multiArray;
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
this.multiIndex = multiIndex
|
||||
// this.setData({ multiArray: multiArray, multiIndex: multiIndex});
|
||||
},
|
||||
// 授权回调
|
||||
onLoadFun: function() {
|
||||
this.getUserAddress();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
toggleTab(str) {
|
||||
this.$refs[str].show();
|
||||
},
|
||||
// bindRegionChange: function(e) {
|
||||
// this.$set(this, 'region', e.detail.value);
|
||||
// },
|
||||
onConfirm(val) {
|
||||
this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
|
||||
},
|
||||
getUserAddress: function() {
|
||||
if (!this.id) return false;
|
||||
let that = this;
|
||||
getAddressDetail(this.id).then(res => {
|
||||
// let region = [res.data.province, res.data.city, res.data.district];
|
||||
let region = [res.data.province, res.data.city, res.data.district];
|
||||
that.$set(that, 'userAddress', res.data);
|
||||
that.$set(that, 'region', region);
|
||||
that.city_id = res.data.city_id
|
||||
});
|
||||
},
|
||||
// 导入共享地址(小程序)
|
||||
getWxAddress: function() {
|
||||
let that = this;
|
||||
uni.authorize({
|
||||
scope: 'scope.address',
|
||||
success: function(res) {
|
||||
uni.chooseAddress({
|
||||
success: function(res) {
|
||||
let addressP = {};
|
||||
addressP.province = res.provinceName;
|
||||
addressP.city = res.cityName;
|
||||
addressP.district = res.countyName;
|
||||
editAddress({
|
||||
address: addressP,
|
||||
is_default: 1,
|
||||
real_name: res.userName,
|
||||
post_code: res.postalCode,
|
||||
phone: res.telNumber,
|
||||
detail: res.detailInfo,
|
||||
id: 0,
|
||||
type: 1,
|
||||
}).then(res => {
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
|
||||
res.data
|
||||
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
return that.$util.Tips({
|
||||
title: "添加成功",
|
||||
icon: 'success'
|
||||
});
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
fail: function(res) {
|
||||
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
|
||||
title: '取消选择'
|
||||
});
|
||||
},
|
||||
})
|
||||
},
|
||||
fail: function(res) {
|
||||
uni.showModal({
|
||||
title: '您已拒绝导入微信地址权限',
|
||||
content: '是否进入权限管理,调整授权?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: function(res) {}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
return that.$util.Tips({
|
||||
title: '已取消!'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
// 导入共享地址(微信);
|
||||
getAddress() {
|
||||
let that = this;
|
||||
that.$wechat.openAddress().then(userInfo => {
|
||||
open();
|
||||
editAddress({
|
||||
id: this.id,
|
||||
real_name: userInfo.userName,
|
||||
phone: userInfo.telNumber,
|
||||
address: {
|
||||
province: userInfo.provinceName,
|
||||
city: userInfo.cityName,
|
||||
district: userInfo.countryName
|
||||
},
|
||||
detail: userInfo.detailInfo,
|
||||
is_default: 1,
|
||||
post_code: userInfo.postalCode,
|
||||
type: 1,
|
||||
})
|
||||
.then(() => {
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
|
||||
res.data
|
||||
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:'/pages/users/user_address_list/index'
|
||||
})
|
||||
// history.back();
|
||||
}
|
||||
}, 1000);
|
||||
close();
|
||||
that.$util.Tips({
|
||||
title: "添加成功",
|
||||
icon: 'success'
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
close();
|
||||
return that.$util.Tips({
|
||||
title: err || "添加失败"
|
||||
});
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 提交用户添加地址
|
||||
*
|
||||
*/
|
||||
formSubmit: function(e) {
|
||||
let that = this,
|
||||
value = e.detail.value;
|
||||
if (!value.real_name) return that.$util.Tips({
|
||||
title: '请填写收货人姓名'
|
||||
});
|
||||
if (!value.phone) return that.$util.Tips({
|
||||
title: '请填写联系电话'
|
||||
});
|
||||
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码'
|
||||
});
|
||||
if (that.region == '省-市-区') return that.$util.Tips({
|
||||
title: '请选择所在地区'
|
||||
});
|
||||
if (!value.detail) return that.$util.Tips({
|
||||
title: '请填写详细地址'
|
||||
});
|
||||
value.id = that.id;
|
||||
let regionArray = that.region;
|
||||
value.address = {
|
||||
province: regionArray[0],
|
||||
city: regionArray[1],
|
||||
district: regionArray[2],
|
||||
city_id: that.cityId,
|
||||
};
|
||||
value.is_default = that.userAddress.is_default ? 1 : 0;
|
||||
|
||||
uni.showLoading({
|
||||
title: '保存中',
|
||||
mask: true
|
||||
})
|
||||
editAddress(value).then(res => {
|
||||
if (that.id)
|
||||
that.$util.Tips({
|
||||
title: '修改成功',
|
||||
icon: 'success'
|
||||
});
|
||||
else
|
||||
that.$util.Tips({
|
||||
title: '添加成功',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(function() {
|
||||
if (that.cartId) {
|
||||
let cartId = that.cartId;
|
||||
let pinkId = that.pinkId;
|
||||
let couponId = that.couponId;
|
||||
that.cartId = '';
|
||||
that.pinkId = '';
|
||||
that.couponId = '';
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data.id) +'&pinkId=' + pinkId + '&couponId=' + couponId
|
||||
});
|
||||
} else {
|
||||
// #ifdef H5
|
||||
return history.back();
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
return uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
}, 1000);
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
ChangeIsDefault: function(e) {
|
||||
this.$set(this.userAddress, 'is_default', !this.userAddress.is_default);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.addAddress .list {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.addAddress .list .item {
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.addAddress .list .item .name {
|
||||
width: 195rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.addAddress .list .item .address {
|
||||
// width: 412rpx;
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item input {
|
||||
width: 475rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item .placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker {
|
||||
width: 475rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .picker {
|
||||
width: 410rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.addAddress .list .item picker .iconfont {
|
||||
font-size: 43rpx;
|
||||
}
|
||||
|
||||
.addAddress .default {
|
||||
padding: 0 30rpx;
|
||||
height: 90rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 23rpx;
|
||||
}
|
||||
|
||||
.addAddress .default checkbox {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.addAddress .keepBnt {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 50rpx auto;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.addAddress .wechatAddress {
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 32rpx;
|
||||
color: #fe960f;
|
||||
border: 1px solid #fe960f;
|
||||
}
|
||||
</style>
|
|
@ -52,7 +52,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -102,6 +102,16 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserAddress(true);
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (this.isLogin) {
|
||||
this.cartId = options.cartId || '';
|
||||
|
@ -112,13 +122,7 @@
|
|||
this.bargain = options.bargain || false;
|
||||
this.getAddressList(true);
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -78,13 +78,7 @@
|
|||
if (this.isLogin) {
|
||||
this.getUserBillList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -116,6 +110,7 @@
|
|||
getUserBillList: function() {
|
||||
let that = this;
|
||||
if (that.loadend) return;
|
||||
|
||||
if (that.loading) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = "";
|
||||
|
@ -126,7 +121,7 @@
|
|||
}
|
||||
getBillList(data).then(function(res) {
|
||||
let list = res.data.list?res.data.list:[],
|
||||
loadend = list.length < that.limit;
|
||||
loadend = res.data.list < res.data.limit;
|
||||
that.userBillList = that.$util.SplitArray(list, that.userBillList);
|
||||
that.$set(that, 'userBillList', that.userBillList);
|
||||
that.loadend = loadend;
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -165,19 +165,24 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.getUserExtractBank();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
this.getUserExtractBank();
|
||||
//this.getBrokerageCommission();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<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='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : ''">
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class="pic-num">满{{ item.minPrice }}元可用</view>
|
||||
<view>¥<text class='num'>{{item.money?Number(item.money):''}}</text></view>
|
||||
<view class="pic-num">满{{ item.minPrice?Number(item.minPrice):'' }}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line2'>
|
||||
|
@ -26,7 +26,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -73,17 +73,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUseCoupons();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUseCoupons();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<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='money' :class='item.isUse ? "moneyGray" : "" '>
|
||||
<view>¥<text class='num'>{{item.money}}</text></view>
|
||||
<view class="pic-num">满{{item.minPrice}}元可用</view>
|
||||
<view>¥<text class='num'>{{item.money?Number(item.money):''}}</text></view>
|
||||
<view class="pic-num">满{{item.minPrice?Number(item.minPrice):''}}元可用</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line2'>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -69,19 +69,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUseCoupons();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
if(this.isLogin){
|
||||
// #ifdef H5
|
||||
this.getUseCoupons();
|
||||
// #endif
|
||||
}else{
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this,'isShowAuth',true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -75,16 +75,13 @@
|
|||
computed: mapGetters(['isLogin']),
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.loadend = false;
|
||||
this.page = 1;
|
||||
this.collectProductList = [];
|
||||
this.get_user_collect_product();
|
||||
this.get_host_product();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
|
|
|
@ -16,13 +16,19 @@
|
|||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>手机号码</view>
|
||||
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!userInfo.phone">
|
||||
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input">
|
||||
<view class='input acea-row row-between-wrapper'>
|
||||
<input type='text' disabled='true' name='phone' :value='userInfo.phone' class='id'></input>
|
||||
<text class='iconfont icon-xiangyou'></text>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- <navigator url="/pages/users/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>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>ID号</view>
|
||||
|
@ -53,7 +59,7 @@
|
|||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -93,17 +99,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
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: {
|
||||
|
@ -164,6 +174,8 @@
|
|||
getUserInfo().then(res => {
|
||||
res.data.localPath = res.data.avatar;
|
||||
that.$set(that, 'userInfo', res.data);
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -109,18 +109,23 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.getIntegralList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
this.getIntegralList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<recommend :hostProduct="hostProduct" v-if="hostProduct.length"></recommend>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -174,6 +174,19 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.get_host_product();
|
||||
this.get_activity();
|
||||
this.userDalance();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
|
@ -181,13 +194,7 @@
|
|||
this.get_activity();
|
||||
this.userDalance();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -102,6 +102,18 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.getRecharge();
|
||||
this.getUserExtractBank();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// #ifdef H5
|
||||
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5"
|
||||
|
@ -111,13 +123,7 @@
|
|||
this.getRecharge();
|
||||
this.getUserExtractBank();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<template>
|
||||
<view>
|
||||
<form @submit="editPwd" report-submit='true'>
|
||||
<view class="ChangePassword">
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view class="item" v-if="isNew">
|
||||
<input type='number' disabled='true' placeholder='填写手机号码1' placeholder-class='placeholder' v-model="userInfo.phone"></input>
|
||||
</view>
|
||||
<view class="item" v-if="!isNew">
|
||||
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone"></input>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
|
@ -13,11 +15,11 @@
|
|||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<button form-type="submit" class="confirmBnt bg-color">确认绑定</button>
|
||||
<button form-type="submit" v-if="isNew" class="confirmBnt bg-color" @click="next">下一步</button>
|
||||
<button form-type="submit" v-if="!isNew" class="confirmBnt bg-color" @click="editPwd">保存</button>
|
||||
</view>
|
||||
</form>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -27,7 +29,8 @@
|
|||
import {
|
||||
registerVerify,
|
||||
bindingPhone,
|
||||
verifyCode
|
||||
verifyCode,
|
||||
bindingVerify
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
toLogin
|
||||
|
@ -51,31 +54,75 @@
|
|||
captcha:'',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
key: ''
|
||||
key: '',
|
||||
isNew: true,
|
||||
timer: '',
|
||||
text: '获取验证码',
|
||||
nums: 60
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
mounted() {
|
||||
// this.timer = setInterval(this.getTimes, 1000);
|
||||
},
|
||||
computed: mapGetters(['isLogin','userInfo']),
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
// verifyCode().then(res=>{
|
||||
// this.$set(this, 'key', res.data.key)
|
||||
// });
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTimes(){
|
||||
this.nums = this.nums - 1;
|
||||
this.text = "剩余 " + this.nums + "s";
|
||||
if (this.nums < 0) {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
this.text = "剩余 " + this.nums + "s";
|
||||
if (this.text < "剩余 " + 0 + "s") {
|
||||
this.disabled = false;
|
||||
this.text = "重新获取";
|
||||
}
|
||||
},
|
||||
onLoadFun:function(){},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
next() {
|
||||
uni.hideLoading();
|
||||
this.isNew = false;
|
||||
this.captcha = '';
|
||||
clearInterval(this.timer);
|
||||
this.disabled = false;
|
||||
this.text = "获取验证码";
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
if (!this.captcha) return this.$util.Tips({
|
||||
title: '请填写验证码'
|
||||
});
|
||||
bindingVerify({
|
||||
phone: this.userInfo.phone,
|
||||
captcha: this.captcha
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
this.isNew = false;
|
||||
this.captcha = '';
|
||||
clearInterval(this.timer);
|
||||
this.disabled = false;
|
||||
this.text = "获取验证码";
|
||||
}).catch(err => {
|
||||
return this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
uni.hideLoading();
|
||||
})
|
||||
},
|
||||
editPwd: function() {
|
||||
let that = this;
|
||||
if (!that.phone) return that.$util.Tips({
|
||||
|
@ -88,12 +135,12 @@
|
|||
title: '请填写验证码'
|
||||
});
|
||||
uni.showModal({
|
||||
title: '是否绑定账号',
|
||||
title: '是否更换绑定账号',
|
||||
confirmText: '绑定',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
bindingPhone({
|
||||
account: that.phone,
|
||||
phone: that.phone,
|
||||
captcha: that.captcha
|
||||
}).then(res => {
|
||||
return that.$util.Tips({
|
||||
|
@ -110,7 +157,7 @@
|
|||
})
|
||||
} else if (res.cancel) {
|
||||
return that.$util.Tips({
|
||||
title: '您已取消绑定!'
|
||||
title: '您已取消更换绑定!'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: '/pages/users/user_info/index'
|
||||
|
@ -124,22 +171,33 @@
|
|||
*
|
||||
*/
|
||||
async code() {
|
||||
this.nums = 60;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
let that = this;
|
||||
if(!that.isNew){
|
||||
if (!that.phone) return that.$util.Tips({
|
||||
title: '请填写手机号码!'
|
||||
});
|
||||
if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
|
||||
title: '请输入正确的手机号码!'
|
||||
});
|
||||
await registerVerify(that.phone).then(res => {
|
||||
}
|
||||
await registerVerify(that.isNew?that.userInfo.phone:that.phone).then(res => {
|
||||
that.$util.Tips({
|
||||
title: res.message
|
||||
});
|
||||
that.sendCode();
|
||||
|
||||
that.timer = setInterval(that.getTimes, 1000);
|
||||
that.disabled = true;
|
||||
uni.hideLoading();
|
||||
}).catch(err => {
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</form>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -63,17 +63,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
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: {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -67,17 +67,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getOrderList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getOrderList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
<view class='wrapper'>
|
||||
<view class='list acea-row row-between-wrapper'>
|
||||
<view class='item' v-for="(item,index) in signSystemList" :key="index">
|
||||
<view :class='(index+1) == signSystemList.length ? "rewardTxt" : ""'>{{item.title}}</view>
|
||||
<view :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'rewardTxt' : '')">{{item.title}}</view>
|
||||
<!-- <view :class='(index+1) == signSystemList.length ? "rewardTxt" : ""'>{{item.title}}</view> -->
|
||||
<view class='venus' :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')"></view>
|
||||
<view class='num' :class='item.is_sgin ? "on" : ""'>+{{item.integral}}</view>
|
||||
</view>
|
||||
|
@ -64,7 +65,7 @@
|
|||
<view class='mask' @touchmove.stop.prevent="false" :hidden='active==false'></view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -109,19 +110,25 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getUserInfo();
|
||||
this.getSignSysteam();
|
||||
this.getSignList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
this.getSignSysteam();
|
||||
this.getSignList();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
@ -51,17 +51,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch:{
|
||||
isLogin:{
|
||||
handler:function(newV,oldV){
|
||||
if(newV){
|
||||
this.getSignMoneList();
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
if(this.isLogin){
|
||||
this.getSignMoneList();
|
||||
}else{
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this,'isShowAuth',true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onReachBottom: function () {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<view class="canvas" v-if="canvasStatus">
|
||||
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
|
||||
|
@ -83,19 +83,23 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.userSpreadBannerList();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
// // #ifdef H5
|
||||
this.userSpreadBannerList();
|
||||
// // #endif
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<view class='itemn acea-row row-between-wrapper'>
|
||||
<view>
|
||||
<view class='name line1'>{{child.title}}</view>
|
||||
<view>{{child.price}}</view>
|
||||
<view>{{child.updateTime}}</view>
|
||||
</view>
|
||||
<view class='num font-color' v-if="child.type == 1">+{{child.price}}</view>
|
||||
<view class='num' v-else>-{{child.price}}</view>
|
||||
|
@ -61,7 +61,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -113,13 +113,7 @@
|
|||
if (this.isLogin) {
|
||||
this.type = options.type;
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
onShow: function() {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
</view>
|
||||
|
@ -86,17 +86,21 @@
|
|||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.getSpreadInfo();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -108,17 +112,20 @@
|
|||
this.isShowAuth = e
|
||||
},
|
||||
openSubscribe: function(page) {
|
||||
uni.showLoading({
|
||||
title: '正在加载',
|
||||
})
|
||||
openExtrctSubscribe().then(res => {
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: page,
|
||||
});
|
||||
}).catch(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
// uni.showLoading({
|
||||
// title: '正在加载',
|
||||
// })
|
||||
// openExtrctSubscribe().then(res => {
|
||||
// uni.hideLoading();
|
||||
// uni.navigateTo({
|
||||
// url: page,
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
},
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
</view>
|
||||
<navigator url="/pages/goods_cate/goods_cate" class="button" hover-class="none" open-type='switchTab'>去获取</navigator>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<!-- <view class="item acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-middle">
|
||||
<view class="pictrue on2"><text class="iconfont icon-yaoqing"></text></view>
|
||||
<view class="text">
|
||||
|
@ -99,7 +99,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<navigator url="/pages/users/user_spread_code/index" class="button" hover-class="none">去获取</navigator>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -163,6 +163,8 @@
|
|||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.$store.commit("SETUID", res.data.uid);
|
||||
that.$store.commit("UPDATE_USERINFO", res.data);
|
||||
that.userInfo = res.data;
|
||||
that.levelInfo = res.data.experience;
|
||||
}).catch(function(res) {
|
||||
|
|
|
@ -1,480 +0,0 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class='member-center'>
|
||||
<view class='header'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
|
||||
@change="bindchange" previous-margin="30px" next-margin="30px">
|
||||
<block v-for="(item,index) in VipList" :key="index">
|
||||
<swiper-item>
|
||||
<view class="memberBg" :class="swiperIndex == index ? 'active' : 'quiet'" :style='"background-image:url("+item.image+")"'
|
||||
mode='aspectFill'>
|
||||
<view class='name'>{{item.name}}</view>
|
||||
<view class='discount'>可享受商品折扣:{{item.discount}}折<text class='iconfont icon-zhekou'></text></view>
|
||||
<view class='lock' v-if="item.grade < grade"><text class='iconfont icon-xuanzhong1'></text>已解锁更高等级</view>
|
||||
|
||||
<view class='lock' v-if="item.grade > grade"><text class='iconfont icon-quanxianguanlisuozi'></text>该会员等级尚未解锁</view>
|
||||
|
||||
<view class='nav acea-row' v-if="grade==item.grade">
|
||||
<view class='item' v-if="indexn <= 3" v-for="(itemn,indexn) in item.task_list" :key="indexn">
|
||||
<view class='num'>{{itemn.number}}</view>
|
||||
<view>{{itemn.real_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class='wrapper'>
|
||||
<view class='title acea-row row-between-wrapper'>
|
||||
<view><text class='iconfont icon-jingyanzhi'></text>会员升级要求</view>
|
||||
<view class='num'><text class='current'>{{reach_count || 0}}</text>/{{task.length || 0}}</view>
|
||||
</view>
|
||||
<view class='list'>
|
||||
<view class='item' v-for="(item,index) in task" :key="index">
|
||||
<view class='top acea-row row-between-wrapper'>
|
||||
<view class='name' @click='opHelp(index)'>{{item.name}}<text v-if="item.illustrate" class='iconfont icon-wenti'></text></view>
|
||||
<view v-if="item.finish">已满足条件</view>
|
||||
<view v-else>未满足条件</view>
|
||||
</view>
|
||||
<view class="cu-progress">
|
||||
<view class='bg-red' :style="'width:'+item.speed+'%;'"></view>
|
||||
</view>
|
||||
<view class='experience acea-row row-between-wrapper'>
|
||||
<view>{{item.task_type_title}}</view>
|
||||
<view><text class='num'>{{item.new_number || 0}}</text>/{{item.number || 0}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
<view class='growthValue' :class='growthValue==false?"on":""'>
|
||||
<view class='pictrue'>
|
||||
<image src='../../columnGoods/static/value.jpg'></image><text class='iconfont icon-guanbi3' @click='growthValue'></text>
|
||||
</view>
|
||||
<view class='conter'>{{illustrate}}</view>
|
||||
</view>
|
||||
<view class='mask' :hidden='growthValue' @click='growthValueClose'></view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
userLevelGrade,
|
||||
userLevelTask,
|
||||
userLevelDetection
|
||||
} from '@/api/user.js';
|
||||
import {
|
||||
getProductHot
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
// #endif
|
||||
import recommend from '@/components/recommend';
|
||||
export default {
|
||||
components: {
|
||||
recommend,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reach_count:0,
|
||||
VipList: [],
|
||||
indicatorDots: false,
|
||||
circular: true,
|
||||
autoplay: false,
|
||||
interval: 3000,
|
||||
duration: 500,
|
||||
swiperIndex: 0,
|
||||
growthValue: true,
|
||||
task: [], //任务列表
|
||||
illustrate: '', //任务说明
|
||||
level_id: 0, //任务id,
|
||||
hostProduct: [],
|
||||
grade: 0,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false ,//是否隐藏授权
|
||||
hotScroll:false,
|
||||
hotPage:1,
|
||||
hotLimit:10
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
VipList: function() {
|
||||
console.log('观察')
|
||||
let that = this;
|
||||
if (that.VipList.length > 0) {
|
||||
that.VipList.forEach(function(item, index) {
|
||||
if (item.is_clear === false) {
|
||||
// that.swiper.slideTo(index);
|
||||
that.activeIndex = index;
|
||||
that.grade = item.grade;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
this.setLeveLComplete();
|
||||
this.get_host_product();
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.isAuto = true;
|
||||
this.$set(this, 'isShowAuth', true)
|
||||
// #endif
|
||||
}
|
||||
let that = this;
|
||||
setTimeout(function() {
|
||||
that.loading = true
|
||||
}, 500)
|
||||
},
|
||||
methods: {
|
||||
onLoadFun: function() {
|
||||
this.setLeveLComplete();
|
||||
this.get_host_product();
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
/**
|
||||
* 获取我的推荐
|
||||
*/
|
||||
get_host_product: function() {
|
||||
let that = this;
|
||||
getProductHot().then(res => {
|
||||
let that = this;
|
||||
if(that.hotScroll) return
|
||||
getProductHot(
|
||||
that.hotPage,
|
||||
that.hotLimit,
|
||||
).then(res => {
|
||||
that.hotPage++
|
||||
that.hotScroll = res.data.length<that.hotLimit
|
||||
that.hostProduct = that.hostProduct.concat(res.data)
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 会员切换
|
||||
*
|
||||
*/
|
||||
bindchange(e) {
|
||||
let index = e.detail.current;
|
||||
this.swiperIndex = index;
|
||||
this.level_id = this.VipList[index].id || 0;
|
||||
// this.grade = this.VipList[index].grade
|
||||
this.getTask();
|
||||
},
|
||||
/**
|
||||
* 关闭说明
|
||||
*/
|
||||
growthValueClose: function() {
|
||||
this.growthValue = true;
|
||||
},
|
||||
/**
|
||||
* 打开说明
|
||||
*/
|
||||
opHelp: function(index) {
|
||||
this.growthValue = false;
|
||||
this.illustrate = this.task[index].illustrate;
|
||||
},
|
||||
/**
|
||||
* 设置会员
|
||||
*/
|
||||
setLeveLComplete: function() {
|
||||
let that = this;
|
||||
userLevelDetection().then(res => {
|
||||
that.getVipList();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取会员等级
|
||||
*
|
||||
*/
|
||||
getVipList: function() {
|
||||
let that = this;
|
||||
userLevelGrade().then(res => {
|
||||
that.$set(that, 'VipList', res.data.list);
|
||||
that.task = res.data.task.task;
|
||||
that.reach_count = res.data.task.reach_count;
|
||||
that.level_id = res.data.list[0] ? res.data.list[0].id : 0;
|
||||
let arr = [];
|
||||
// res.data.list.forEach(function(item, index) {
|
||||
// if (item.is_clear == false) {
|
||||
// arr.push(item.grade);
|
||||
// }
|
||||
// })
|
||||
// that.grade = arr[0] || 0;
|
||||
// that.grade = res.data.list[0].grade
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取任务要求
|
||||
*/
|
||||
getTask: function() {
|
||||
let that = this;
|
||||
userLevelTask(that.level_id).then(res => {
|
||||
that.task = res.data.task;
|
||||
that.reach_count = res.data.reach_count;
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.get_host_product();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.member-center .header {
|
||||
background-color: #232323;
|
||||
width: 100%;
|
||||
padding: 50rpx 0;
|
||||
}
|
||||
|
||||
.member-center .header swiper {
|
||||
width: 100%;
|
||||
height: 328rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg.active {
|
||||
transform: none;
|
||||
transition: all 0.2s ease-in 0s;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg.quiet {
|
||||
transform: scale(0.9);
|
||||
transition: all 0.2s ease-in 0s;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg {
|
||||
width: 100%;
|
||||
height: 328rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
background-size: 100% 100%
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg image {
|
||||
width: 89rpx;
|
||||
height: 108rpx;
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 60rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .name {
|
||||
font-size: 46rpx;
|
||||
font-weight: bold;
|
||||
padding: 40rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .discount {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
margin: 15rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .discount .iconfont {
|
||||
margin-left: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav {
|
||||
margin-top: 55rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item .num {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
font-family: 'Guildford Pro';
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .nav .item~.item::before {
|
||||
position: absolute;
|
||||
width: 2rpx;
|
||||
height: 32rpx;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
content: '';
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .lock {
|
||||
font-size: 26rpx;
|
||||
margin: 73rpx 0 0 35rpx;
|
||||
}
|
||||
|
||||
.member-center .header swiper-item .memberBg .lock .iconfont {
|
||||
font-size: 37rpx;
|
||||
margin-right: 15rpx;
|
||||
vertical-align: -4rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper {
|
||||
background-color: #fff;
|
||||
padding-bottom: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title {
|
||||
height: 98rpx;
|
||||
padding: 0 30rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .iconfont {
|
||||
color: #ffae06;
|
||||
font-weight: normal;
|
||||
font-size: 40rpx;
|
||||
margin-right: 12rpx;
|
||||
vertical-align: -2rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .num {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .title .num .current {
|
||||
color: #ffae06;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item {
|
||||
width: 690rpx;
|
||||
height: 184rpx;
|
||||
background-color: #f9f9f9;
|
||||
margin: 0 auto 20rpx auto;
|
||||
padding: 27rpx 0 22rpx 0;
|
||||
border-radius: 12rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top {
|
||||
padding-right: 27rpx;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top .name {
|
||||
border-left: 6rpx solid #ffae06;
|
||||
padding-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .top .name .iconfont {
|
||||
color: #999;
|
||||
font-size: 30rpx;
|
||||
vertical-align: -2rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .cu-progress {
|
||||
overflow: hidden;
|
||||
height: 12rpx;
|
||||
background-color: #eee;
|
||||
width: 636rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 35rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .cu-progress .bg-red {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
transition: width 0.6s ease;
|
||||
background-color: #ffaa29;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .experience {
|
||||
margin-top: 17rpx;
|
||||
padding: 0 27rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.member-center .wrapper .list .item .experience .num {
|
||||
color: #ffad07;
|
||||
}
|
||||
|
||||
.member-center .growthValue {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
position: fixed;
|
||||
top: 266rpx;
|
||||
left: 50%;
|
||||
width: 560rpx;
|
||||
height: 740rpx;
|
||||
margin-left: -280rpx;
|
||||
z-index: 99;
|
||||
transform: translate3d(0, -200%, 0);
|
||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||
}
|
||||
|
||||
.member-center .growthValue.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue {
|
||||
width: 100%;
|
||||
height: 257rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
|
||||
.member-center .growthValue .conter {
|
||||
padding: 0 35rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-top: 58rpx;
|
||||
line-height: 1.5;
|
||||
height: 350rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.member-center .growthValue .pictrue .iconfont {
|
||||
position: absolute;
|
||||
font-size: 65rpx;
|
||||
color: #fff;
|
||||
top: 775rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
</style>
|
|
@ -1,10 +1,14 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="page">
|
||||
<view class="system-height" :style="{height:statusBarHeight}"></view>
|
||||
<!-- #ifdef MP -->
|
||||
<view class="title-bar" style="height: 43px;">
|
||||
<view class="icon" @click="back" v-if="!isHome"><image src="../static/left.png" ></image></view>
|
||||
<view class="icon" @click="home" v-else><image src="../static/home.png"></image></view>
|
||||
<view class="icon" @click="back" v-if="!isHome">
|
||||
<image src="../static/left.png"></image>
|
||||
</view>
|
||||
<view class="icon" @click="home" v-else>
|
||||
<image src="../static/home.png"></image>
|
||||
</view>
|
||||
账户登录
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
@ -13,13 +17,13 @@
|
|||
<image src="../static/wechat_login.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="btn-wrapper">
|
||||
<button class="bg-red" hover-class="none" @click="isUp=true">手机号登录(账户同步)</button>
|
||||
<!-- #ifdef H5 -->
|
||||
<button hover-class="none" @click="wechatLogin">微信一键登录</button>
|
||||
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo">微信一键登录</button>
|
||||
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo" class="bg-green btn1">微信登录</button>
|
||||
<!-- #endif -->
|
||||
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="isUp">
|
||||
|
@ -36,6 +40,9 @@
|
|||
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
import mobileLogin from '@/components/login_mobile/index.vue'
|
||||
import routinePhone from '@/components/login_mobile/routine_phone.vue'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
getLogo,
|
||||
silenceAuth,
|
||||
|
@ -73,17 +80,22 @@
|
|||
mobileLogin,
|
||||
routinePhone
|
||||
},
|
||||
computed: mapGetters({
|
||||
'authorizeType': 'authorizeType'
|
||||
}),
|
||||
onLoad(options) {
|
||||
console.log('options',options)
|
||||
if (this.authorizeType === 'register') this.isPhoneBox = true
|
||||
getLogo().then(res => {
|
||||
this.logoUrl = res.data.logo_url
|
||||
this.logoUrl = res.data.logoUrl
|
||||
})
|
||||
let that = this
|
||||
// #ifdef H5
|
||||
document.body.addEventListener("focusout", () => {
|
||||
setTimeout(() => {
|
||||
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
|
||||
}, 100);
|
||||
setTimeout(() => {
|
||||
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
|
||||
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
|
||||
}, 100);
|
||||
});
|
||||
const {
|
||||
code,
|
||||
|
@ -91,38 +103,44 @@
|
|||
scope
|
||||
} = options;
|
||||
this.options = options
|
||||
console.log('lalaal',this.options)
|
||||
// 获取确认授权code
|
||||
this.code = code || ''
|
||||
if(code){
|
||||
let spread = app.globalData.spid ? app.globalData.spid : '';
|
||||
//公众号授权登录回调
|
||||
wechat.auth(code, state).then(res => {
|
||||
if (res.key !== undefined && res.key) {
|
||||
that.authKey = res.key;
|
||||
that.isUp = true
|
||||
}else{
|
||||
let time = res.expires_time - that.$Cache.time();
|
||||
that.$store.commit('LOGIN', {
|
||||
token: res.token,
|
||||
time: time
|
||||
if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||
if (code && this.options.scope !== 'snsapi_base') {
|
||||
let spread = app.globalData.spid ? app.globalData.spid : 0;
|
||||
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
|
||||
wechat.auth(code, spread).then(res => {
|
||||
console.log('进来的授权',res)
|
||||
if (res.type === 'register') {
|
||||
this.authKey = res.key;
|
||||
console.log('authKey',this.authKey)
|
||||
this.isUp = true
|
||||
}
|
||||
if(res.type === 'login'){
|
||||
// let time = res.data.expires_time - this.$Cache.time();
|
||||
this.$store.commit('LOGIN', {
|
||||
token: res.data.token,
|
||||
// time: time
|
||||
});
|
||||
that.userInfo = res.userInfo
|
||||
that.$store.commit("SETUID", res.userInfo.uid);
|
||||
that.$store.commit("UPDATE_USERINFO", res.userInfo);
|
||||
that.wechatPhone()
|
||||
// this.$store.commit('SETUID', res.data.userInfo.uid);
|
||||
// this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
|
||||
this.wechatPhone();
|
||||
//location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||
}
|
||||
}).catch(error => {
|
||||
// location.replace("/");
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
let pages = getCurrentPages();
|
||||
let prePage = pages[pages.length - 2];
|
||||
if(prePage.route == 'pages/order_addcart/order_addcart'){
|
||||
this.isHome = true
|
||||
}else{
|
||||
this.isHome = false
|
||||
}
|
||||
console.log('数据库1',pages)
|
||||
// let prePage = pages[pages.length - 2];
|
||||
// console.log('数据库',prePage)
|
||||
// if (prePage.route == 'pages/order_addcart/order_addcart') {
|
||||
// this.isHome = true
|
||||
// } else {
|
||||
// this.isHome = false
|
||||
// }
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
@ -174,7 +192,9 @@
|
|||
iv: iv,
|
||||
code: code,
|
||||
spid: app.globalData.spid,
|
||||
spread: app.globalData.code
|
||||
spread: app.globalData.code,
|
||||
type: 'routine',
|
||||
key: this.authKey
|
||||
})
|
||||
.then(res => {
|
||||
let time = res.data.expires_time - this.$Cache.time();
|
||||
|
@ -194,8 +214,10 @@
|
|||
|
||||
})
|
||||
.catch(res => {
|
||||
console.log(res);
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
@ -217,7 +239,9 @@
|
|||
});
|
||||
},
|
||||
setUserInfo(e) {
|
||||
uni.showLoading({ title: '正在登录中' });
|
||||
uni.showLoading({
|
||||
title: '正在登录中'
|
||||
});
|
||||
Routine.getCode()
|
||||
.then(code => {
|
||||
this.getWxUser(code);
|
||||
|
@ -234,11 +258,19 @@
|
|||
userInfo.code = code;
|
||||
userInfo.spread_spid = app.globalData.spid;//获取推广人ID
|
||||
userInfo.spread_code = app.globalData.code;//获取推广人分享二维码ID
|
||||
Routine.authUserInfo(userInfo)
|
||||
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;
|
||||
userInfo.type = 'routine'
|
||||
Routine.authUserInfo(userInfo.code, userInfo)
|
||||
.then(res => {
|
||||
if(res.data.key !== undefined && res.data.key){
|
||||
uni.hideLoading();
|
||||
console.log(res)
|
||||
self.authKey = res.data.key;
|
||||
if (res.data.type === 'register') {
|
||||
uni.hideLoading();
|
||||
self.isPhoneBox = true
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
|
@ -254,7 +286,6 @@
|
|||
tab: 3
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
.catch(res => {
|
||||
uni.hideLoading();
|
||||
|
@ -289,10 +320,37 @@
|
|||
},
|
||||
// 公众号登录
|
||||
wechatLogin() {
|
||||
if(!this.code){
|
||||
this.$wechat.oAuth('','/pages/users/wechat_login/index')
|
||||
console.log('微信登录',this.code)
|
||||
console.log('微信登录2',this.options.code)
|
||||
console.log('微信登录3',this.authKey)
|
||||
console.log('isUp2',this.isUp)
|
||||
if (!this.code && this.options.scope !== 'snsapi_base') {
|
||||
this.$wechat.oAuth('snsapi_userinfo', '/pages/users/wechat_login/index');
|
||||
} else {
|
||||
console.log('isUp',this.isUp)
|
||||
// if (this.authKey) {
|
||||
// this.isUp = true;
|
||||
// }
|
||||
this.isUp = true;
|
||||
}
|
||||
// wechat.auth(this.code, this.$Cache.get("spread")).then(res => {
|
||||
// if (res.data.type === 'register') {
|
||||
// this.authKey = res.data.key;
|
||||
// this.isUp = true
|
||||
// }
|
||||
// if(res.data.type === 'login'){
|
||||
// let time = res.data.expires_time - this.$Cache.time();
|
||||
// this.$store.commit('LOGIN', {
|
||||
// token: res.data.token,
|
||||
// time: time
|
||||
// });
|
||||
// this.$store.commit('SETUID', res.data.userInfo.uid);
|
||||
// this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
|
||||
// // location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// // location.replace("/");
|
||||
// });
|
||||
},
|
||||
// 输入手机号后的回调
|
||||
wechatPhone() {
|
||||
|
@ -316,11 +374,15 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.wechat_login {
|
||||
padding: 72rpx 34rpx;
|
||||
|
||||
|
@ -330,21 +392,24 @@
|
|||
|
||||
.btn-wrapper {
|
||||
margin-top: 86rpx;
|
||||
padding: 0 66rpx;
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
height: 86rpx;
|
||||
line-height: 86rpx;
|
||||
margin-bottom: 40rpx;
|
||||
color: $theme-color;
|
||||
border: 1px solid $theme-color;
|
||||
border-radius: 120rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
&.bg-red {
|
||||
background: $theme-color;
|
||||
&.btn1 {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.btn2 {
|
||||
color: #666666;
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -356,6 +421,7 @@
|
|||
justify-content: center;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
|
@ -365,6 +431,7 @@
|
|||
justify-content: center;
|
||||
width: 86rpx;
|
||||
height: 86rpx;
|
||||
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
|
|
|
@ -313,7 +313,7 @@
|
|||
.coupon-list .item .text .data .bnt.gray{background-color:#ccc;}
|
||||
|
||||
.noCommodity {
|
||||
border-top: 7rpx solid #f5f5f5
|
||||
//border-top: 7rpx solid #f5f5f5
|
||||
}
|
||||
|
||||
.noCommodity .pictrue {
|
||||
|
@ -720,3 +720,6 @@
|
|||
uni-checkbox:not([disabled]) .uni-checkbox-input:hover{
|
||||
border-color: #d1d1d1;
|
||||
}
|
||||
.bg-green{
|
||||
background-color: #3CBB45;
|
||||
}
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 19 KiB |