|
|
@ -1,14 +1,16 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
|
|
|
|
<!-- #ifdef H5 --> |
|
|
|
<view class="header"> |
|
|
|
<view class="header"> |
|
|
|
<!-- 头部-默认显示 --> |
|
|
|
<!-- 头部-默认显示 --> |
|
|
|
<view class="before" :style="{ opacity: 1 - afterHeaderOpacity, zIndex: beforeHeaderzIndex }"> |
|
|
|
<view class="before" :style="{ opacity: 1 - afterHeaderOpacity, zIndex: beforeHeaderzIndex }"> |
|
|
|
<view class="back"><view class="icon xiangqian" @tap="back" v-if="showBack"></view></view> |
|
|
|
<view class="back"> |
|
|
|
|
|
|
|
<view class="icon xiangqian" @tap="back" v-if="showBack"></view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="middle"></view> |
|
|
|
<view class="middle"></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- #endif --> |
|
|
|
<!-- 底部菜单 --> |
|
|
|
<!-- 底部菜单 --> |
|
|
|
<view class="footer"> |
|
|
|
<view class="footer"> |
|
|
|
<button v-if="user == '' " class="width100 fotct btnfot" @click="getuserinfo"> |
|
|
|
<button v-if="user == '' " class="width100 fotct btnfot" @click="getuserinfo"> |
|
|
@ -95,11 +97,14 @@ |
|
|
|
<view class="description"> |
|
|
|
<view class="description"> |
|
|
|
<view class="title">———— 商品详情 ————</view> |
|
|
|
<view class="title">———— 商品详情 ————</view> |
|
|
|
<view class="content marb65"> |
|
|
|
<view class="content marb65"> |
|
|
|
<image mode="widthFix" class="width100" v-for="codes in couponDesc" :key="codes" :src="imageUrl+codes" @click="perImage(codes)"> |
|
|
|
<image mode="widthFix" class="width100" v-for="codes in couponDesc" :key="codes" :src="imageUrl+codes" |
|
|
|
|
|
|
|
@click="perImage(codes)"> |
|
|
|
</image> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <authorize></authorize> --> |
|
|
|
<!-- #ifdef H5 --> |
|
|
|
|
|
|
|
<authorize></authorize> |
|
|
|
|
|
|
|
<!-- #endif --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -109,12 +114,12 @@ |
|
|
|
GetPhoneNumber, |
|
|
|
GetPhoneNumber, |
|
|
|
getUserInfo |
|
|
|
getUserInfo |
|
|
|
} from "../../Utils/Api.js"; |
|
|
|
} from "../../Utils/Api.js"; |
|
|
|
// import authorize from '../../components/Authorize.vue' |
|
|
|
import authorize from '../../components/Authorize.vue' |
|
|
|
let app = getApp() |
|
|
|
let app = getApp() |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
// components: { |
|
|
|
components: { |
|
|
|
// authorize |
|
|
|
authorize |
|
|
|
// }, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
//控制渐变标题栏的参数 |
|
|
|
//控制渐变标题栏的参数 |
|
|
@ -201,21 +206,11 @@ |
|
|
|
//查看大图 |
|
|
|
//查看大图 |
|
|
|
perImage(item) { |
|
|
|
perImage(item) { |
|
|
|
uni.previewImage({ |
|
|
|
uni.previewImage({ |
|
|
|
current: 0, //预览图片的下标 |
|
|
|
current: 0, //预览图片的下标 |
|
|
|
urls: [this.imageUrl+item] //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以 |
|
|
|
urls: [this.imageUrl + item] //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//商品跳转 |
|
|
|
|
|
|
|
// toGoods(e) { |
|
|
|
|
|
|
|
// console.log('=========='+e); |
|
|
|
|
|
|
|
// // uni.showToast({ |
|
|
|
|
|
|
|
// // title: '商品' + e.goods_id, |
|
|
|
|
|
|
|
// // icon: 'none' |
|
|
|
|
|
|
|
// // }); |
|
|
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
|
|
|
// url: 'goods' |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 跳转门店详情 |
|
|
|
* 跳转门店详情 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -234,12 +229,7 @@ |
|
|
|
url: '../msg/msg' |
|
|
|
url: '../msg/msg' |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 客服 |
|
|
|
|
|
|
|
toChat() { |
|
|
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
|
|
|
// url:"../msg/chat/chat?name=客服008" |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 分享 |
|
|
|
// 分享 |
|
|
|
share() { |
|
|
|
share() { |
|
|
|
this.shareClass = 'show'; |
|
|
|
this.shareClass = 'show'; |
|
|
@ -267,46 +257,6 @@ |
|
|
|
title: "已加入购物车" |
|
|
|
title: "已加入购物车" |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//立即购买 |
|
|
|
|
|
|
|
// getPhoneNumber(PhoneNumber) { |
|
|
|
|
|
|
|
// let params = { |
|
|
|
|
|
|
|
// openId: app.globalData.openId, |
|
|
|
|
|
|
|
// iv: PhoneNumber.detail.iv, |
|
|
|
|
|
|
|
// encryptedData: PhoneNumber.detail.encryptedData |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// GetPhoneNumber(params).then(res => { |
|
|
|
|
|
|
|
// if (res.return_code == '000000') { |
|
|
|
|
|
|
|
// app.globalData.userInfo = res.return_data |
|
|
|
|
|
|
|
// .object |
|
|
|
|
|
|
|
// .highUser; |
|
|
|
|
|
|
|
// uni.setStorage({ |
|
|
|
|
|
|
|
// key: "user", |
|
|
|
|
|
|
|
// data: res.return_data |
|
|
|
|
|
|
|
// .object |
|
|
|
|
|
|
|
// .highUser |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// let that = this; |
|
|
|
|
|
|
|
// if (that.goodsData[0].stockCount) { |
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
|
|
// title: '提交订单...', |
|
|
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
|
|
// duration: 2000, |
|
|
|
|
|
|
|
// success() { |
|
|
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
|
|
|
// url: '../order/confirmation?id=' + that.goodsData[0].id |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
|
|
// title: '卡券数量不足', |
|
|
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
|
|
// duration: 2000 |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
//获取登陆信息 |
|
|
|
//获取登陆信息 |
|
|
|
getuserinfo() { |
|
|
|
getuserinfo() { |
|
|
|
// uni.showLoading({ |
|
|
|
// uni.showLoading({ |
|
|
@ -314,70 +264,65 @@ |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
// wx.login({ |
|
|
|
// wx.login({ |
|
|
|
// success(res) { |
|
|
|
// success(res) { |
|
|
|
// if (res.code) { |
|
|
|
// if (res.code) { |
|
|
|
//发起网络请求 |
|
|
|
//发起网络请求 |
|
|
|
// var code = res.code |
|
|
|
// var code = res.code; |
|
|
|
// 获取微信用户信息 |
|
|
|
// 获取微信用户信息 |
|
|
|
uni.getUserProfile({ |
|
|
|
uni.getUserProfile({ |
|
|
|
desc: '登录中...', |
|
|
|
desc: '登录中...', |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
openId: app.globalData.openId, |
|
|
|
openId: app.globalData.openId, |
|
|
|
iv: res.iv, |
|
|
|
iv: res.iv, |
|
|
|
encryptedData: res.encryptedData |
|
|
|
encryptedData: res.encryptedData |
|
|
|
} |
|
|
|
} |
|
|
|
getUserInfo(params).then(res => { |
|
|
|
getUserInfo(params).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
app.globalData.userInfo = res |
|
|
|
that.user = res.return_data.object.highUser; |
|
|
|
.return_data |
|
|
|
app.globalData.userInfo = res |
|
|
|
.object |
|
|
|
.return_data |
|
|
|
.highUser; |
|
|
|
.object |
|
|
|
app.globalData.token = res |
|
|
|
.highUser; |
|
|
|
.return_data.uniqueCode; |
|
|
|
app.globalData.token = res |
|
|
|
uni.setStorage({ |
|
|
|
.return_data.uniqueCode; |
|
|
|
key: "user", |
|
|
|
uni.setStorage({ |
|
|
|
data: res.return_data |
|
|
|
key: "user", |
|
|
|
.object |
|
|
|
data: res.return_data |
|
|
|
.highUser |
|
|
|
.object |
|
|
|
}) |
|
|
|
.highUser |
|
|
|
uni.setStorage({ |
|
|
|
}) |
|
|
|
key: "token", |
|
|
|
uni.setStorage({ |
|
|
|
data: res.return_data |
|
|
|
key: "token", |
|
|
|
.uniqueCode |
|
|
|
data: res.return_data |
|
|
|
}) |
|
|
|
.uniqueCode |
|
|
|
that.buy(); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
that.buy(); |
|
|
|
uni.hideLoading(); |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.hideLoading(); |
|
|
|
title: res.return_msg, |
|
|
|
uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: res.return_msg, |
|
|
|
duration: 2000 |
|
|
|
icon: 'none', |
|
|
|
}) |
|
|
|
duration: 2000 |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
fail: res => { |
|
|
|
}, |
|
|
|
uni.hideLoading(); |
|
|
|
fail: res => { |
|
|
|
uni.showToast({ |
|
|
|
uni.hideLoading(); |
|
|
|
title: "微信登录授权失败", |
|
|
|
uni.showToast({ |
|
|
|
icon: "none" |
|
|
|
title: "微信登录授权失败", |
|
|
|
}); |
|
|
|
icon: "none" |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
// } else { |
|
|
|
// } else { |
|
|
|
// fail: res => { |
|
|
|
// uni.showToast({ |
|
|
|
// uni.showToast({ |
|
|
|
// title: "微信登录授权失败", |
|
|
|
// title: "微信登录授权失败", |
|
|
|
// icon: "none" |
|
|
|
// icon: "none" |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
// fail(res) { |
|
|
|
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
@ -785,9 +730,11 @@ |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100vw; |
|
|
|
height: 100vw; |
|
|
|
|
|
|
|
|
|
|
|
swiper { |
|
|
|
swiper { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100vw; |
|
|
|
height: 100vw; |
|
|
|
|
|
|
|
|
|
|
|
swiper-item { |
|
|
|
swiper-item { |
|
|
|
image { |
|
|
|
image { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
@ -795,7 +742,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.indicator{ |
|
|
|
|
|
|
|
|
|
|
|
.indicator { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|