|
|
|
|
@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
<view class="myswiper">
|
|
|
|
|
<u-swiper mode="none" border-radius="0" :list="list" height="440"></u-swiper>
|
|
|
|
|
<u-swiper mode="none" @click="clickTop" border-radius="0" :list="list" height="440"></u-swiper>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="tags">
|
|
|
|
|
<view v-for="item in tags">
|
|
|
|
|
@ -62,12 +62,12 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="contact" @click="toUrl(5)">
|
|
|
|
|
<view class="contact" @click="toUrl(5)">
|
|
|
|
|
<image src="../../static/index_icon8.png"></image>
|
|
|
|
|
<view>
|
|
|
|
|
<view>蟹太太官方旗舰店</view>
|
|
|
|
|
<view>
|
|
|
|
|
<view>提货答疑 物流追踪</view>
|
|
|
|
|
<view>提货答疑 物流追踪</view>
|
|
|
|
|
<image src="../../static/index_icon9.png" mode=""></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="contact-btn">
|
|
|
|
|
@ -97,12 +97,12 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue';
|
|
|
|
|
import tabbar from '@/components/tabbar/tabbar.vue';
|
|
|
|
|
import {
|
|
|
|
|
ROOTPATH as baseUrl
|
|
|
|
|
import tabbar from '@/components/tabbar/tabbar.vue';
|
|
|
|
|
import {
|
|
|
|
|
ROOTPATH as baseUrl
|
|
|
|
|
} from "@/common/config.js"
|
|
|
|
|
import {
|
|
|
|
|
isNull,
|
|
|
|
|
isNull,
|
|
|
|
|
toast
|
|
|
|
|
} from '@/common/util.js'
|
|
|
|
|
export default {
|
|
|
|
|
@ -113,8 +113,8 @@
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
list: [],
|
|
|
|
|
tags: ['品牌自营', '品质保障', '顺丰包邮', '售后无忧'],
|
|
|
|
|
banner2:[]
|
|
|
|
|
tags: ['品牌自营', '品质保障', '顺丰包邮', '售后无忧'],
|
|
|
|
|
banner2: []
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -124,15 +124,15 @@
|
|
|
|
|
onShareTimeline() {
|
|
|
|
|
// return shareInfo
|
|
|
|
|
},
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
this.getBanner()
|
|
|
|
|
let token = uni.getStorageSync('xtt_lifeData3')?uni.getStorageSync('xtt_lifeData3').vuex_token:''
|
|
|
|
|
onLoad(option) {
|
|
|
|
|
this.getBanner()
|
|
|
|
|
let token = uni.getStorageSync('xtt_lifeData3') ? uni.getStorageSync('xtt_lifeData3').vuex_token : ''
|
|
|
|
|
if (isNull(token)) {
|
|
|
|
|
this.getToken()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onHide() {
|
|
|
|
|
|
|
|
|
|
@ -146,147 +146,153 @@
|
|
|
|
|
},
|
|
|
|
|
onRejectPrivacy() {
|
|
|
|
|
// 用户拒绝隐私政策
|
|
|
|
|
// 在这里添加您想要执行的代码
|
|
|
|
|
// 在这里添加您想要执行的代码
|
|
|
|
|
// wx.exitMiniProgram();
|
|
|
|
|
console.log('User rejected the privacy policy');
|
|
|
|
|
},
|
|
|
|
|
async getBanner(){
|
|
|
|
|
const res = await this.$u.api.getConfig()
|
|
|
|
|
// 顶部图banner1
|
|
|
|
|
let arr = []
|
|
|
|
|
if(res.banner1.length>0){
|
|
|
|
|
res.banner1.map(item=>{
|
|
|
|
|
arr.push({
|
|
|
|
|
image:item.upfile_url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.list = arr
|
|
|
|
|
}
|
|
|
|
|
// 底部三张 banner2
|
|
|
|
|
if(res.banner2.length>0){
|
|
|
|
|
this.banner2 = res.banner2
|
|
|
|
|
}
|
|
|
|
|
// 轮播图 banner3
|
|
|
|
|
let _arr = []
|
|
|
|
|
if(res.banner3.length>0){
|
|
|
|
|
res.banner3.map(item=>{
|
|
|
|
|
_arr.push({
|
|
|
|
|
image:item.upfile_url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('banner3',_arr)
|
|
|
|
|
}
|
|
|
|
|
// 客服二维码
|
|
|
|
|
let _arr1 = []
|
|
|
|
|
if(res.banner4.length>0){
|
|
|
|
|
res.banner4.map(item=>{
|
|
|
|
|
_arr1.push({
|
|
|
|
|
image:item.upfile_url,
|
|
|
|
|
type:item.url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('banner4',_arr1)
|
|
|
|
|
}
|
|
|
|
|
// 文字信息
|
|
|
|
|
uni.setStorageSync('configs',res.config)
|
|
|
|
|
},
|
|
|
|
|
// 点击轮播图
|
|
|
|
|
clickTop(e) {
|
|
|
|
|
console.log("e", e, this.list[e])
|
|
|
|
|
const appid = this.list[e].appid
|
|
|
|
|
const path = this.list[e].url
|
|
|
|
|
if (!isNull(appid)) {
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
|
|
appId: appid, // 小程序appid
|
|
|
|
|
path: path?path:'', // 打开的页面路径,若为空则打开首页
|
|
|
|
|
extraData: {
|
|
|
|
|
// 需要传递给小程序的数据
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
// 打开成功的回调
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
// 打开失败的回调
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
async getBanner() {
|
|
|
|
|
const res = await this.$u.api.getConfig()
|
|
|
|
|
// 顶部图banner1
|
|
|
|
|
let arr = []
|
|
|
|
|
if (res.banner1.length > 0) {
|
|
|
|
|
res.banner1.map(item => {
|
|
|
|
|
arr.push({
|
|
|
|
|
image: item.upfile_url,
|
|
|
|
|
...item
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.list = arr
|
|
|
|
|
}
|
|
|
|
|
// 底部三张 banner2
|
|
|
|
|
if (res.banner2.length > 0) {
|
|
|
|
|
this.banner2 = res.banner2
|
|
|
|
|
}
|
|
|
|
|
// 轮播图 banner3
|
|
|
|
|
let _arr = []
|
|
|
|
|
if (res.banner3.length > 0) {
|
|
|
|
|
res.banner3.map(item => {
|
|
|
|
|
_arr.push({
|
|
|
|
|
image: item.upfile_url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('banner3', _arr)
|
|
|
|
|
}
|
|
|
|
|
// 客服二维码
|
|
|
|
|
let _arr1 = []
|
|
|
|
|
if (res.banner4.length > 0) {
|
|
|
|
|
res.banner4.map(item => {
|
|
|
|
|
_arr1.push({
|
|
|
|
|
image: item.upfile_url,
|
|
|
|
|
type: item.url
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('banner4', _arr1)
|
|
|
|
|
}
|
|
|
|
|
// 文字信息
|
|
|
|
|
uni.setStorageSync('configs', res.config)
|
|
|
|
|
},
|
|
|
|
|
async getToken() {
|
|
|
|
|
await uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
|
|
|
|
|
success: (res) => {
|
|
|
|
|
this.$u.api.login({
|
|
|
|
|
code: res.code
|
|
|
|
|
}).then(res1 => {
|
|
|
|
|
}).then(res1 => {
|
|
|
|
|
uni.removeStorageSync("xtt_lifeData3")
|
|
|
|
|
uni.setStorageSync("xtt_lifeData3", {
|
|
|
|
|
'vuex_token': res1.token
|
|
|
|
|
})
|
|
|
|
|
// uni.request({
|
|
|
|
|
// url: baseUrl + '/api/mobile/user/show',
|
|
|
|
|
// header: {
|
|
|
|
|
// Authorization: `Bearer ${res1.token}`
|
|
|
|
|
// },
|
|
|
|
|
// method: "GET",
|
|
|
|
|
// success(res2) {
|
|
|
|
|
// uni.setStorageSync("xtt_lifeData3", {
|
|
|
|
|
// 'vuex_token': res1.token,
|
|
|
|
|
// "vuex_user": res2.user
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// fail(err) {
|
|
|
|
|
// console.log("err", err)
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
uni.setStorageSync("xtt_lifeData3", {
|
|
|
|
|
'vuex_token': res1.token
|
|
|
|
|
})
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
toast(JSON.stringify(err))
|
|
|
|
|
console.log('login-error:', JSON.stringify(err))
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
fail: (res) => {
|
|
|
|
|
console.log("errtoken", JSON.stringify(res))
|
|
|
|
|
console.log("errtoken", JSON.stringify(res))
|
|
|
|
|
toast(JSON.stringify(err))
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
toUrl(index) {
|
|
|
|
|
var url = ''
|
|
|
|
|
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
var url = ''
|
|
|
|
|
|
|
|
|
|
if (index == 1) {
|
|
|
|
|
url = '/packages/change/change'
|
|
|
|
|
}else if(index == 2){
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
|
|
appId: 'wx28874f0da33453ab', // 小程序appid
|
|
|
|
|
path: '', // 打开的页面路径,若为空则打开首页
|
|
|
|
|
extraData: {
|
|
|
|
|
// 需要传递给小程序的数据
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
// 打开成功的回调
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
// 打开失败的回调
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else if (index == 2) {
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
|
|
appId: 'wx28874f0da33453ab', // 小程序appid
|
|
|
|
|
path: '', // 打开的页面路径,若为空则打开首页
|
|
|
|
|
extraData: {
|
|
|
|
|
// 需要传递给小程序的数据
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
// 打开成功的回调
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
// 打开失败的回调
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else if (index == 3) {
|
|
|
|
|
url = '/packages/myorder/myorder'
|
|
|
|
|
} else if (index == 4) {
|
|
|
|
|
url = '/packages/myorder/myorder'
|
|
|
|
|
} else if (index == 5) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url:'/packages/product/talkwx'
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/packages/product/talkwx'
|
|
|
|
|
})
|
|
|
|
|
} else if (index == 6) {
|
|
|
|
|
url = '/packages/product/fresh'
|
|
|
|
|
}
|
|
|
|
|
console.log("index",index,url)
|
|
|
|
|
}
|
|
|
|
|
console.log("index", index, url)
|
|
|
|
|
if (!isNull(url)) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
toAd(index){
|
|
|
|
|
let item = this.banner2[index]
|
|
|
|
|
if(item.upfile_url){
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
|
|
appId: item.appid?item.appid:'wx28874f0da33453ab', // 小程序appid
|
|
|
|
|
path: item.url?item.url:'', // 打开的页面路径,若为空则打开首页
|
|
|
|
|
extraData: {
|
|
|
|
|
// 需要传递给小程序的数据
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
// 打开成功的回调
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
// 打开失败的回调
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
toAd(index) {
|
|
|
|
|
let item = this.banner2[index]
|
|
|
|
|
if (item.upfile_url) {
|
|
|
|
|
uni.navigateToMiniProgram({
|
|
|
|
|
appId: item.appid ? item.appid : 'wx28874f0da33453ab', // 小程序appid
|
|
|
|
|
path: item.url ? item.url : '', // 打开的页面路径,若为空则打开首页
|
|
|
|
|
extraData: {
|
|
|
|
|
// 需要传递给小程序的数据
|
|
|
|
|
},
|
|
|
|
|
success(res) {
|
|
|
|
|
// 打开成功的回调
|
|
|
|
|
},
|
|
|
|
|
fail(err) {
|
|
|
|
|
// 打开失败的回调
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -299,7 +305,8 @@
|
|
|
|
|
height: 100vh;
|
|
|
|
|
width: 100vw;
|
|
|
|
|
overflow: scroll;
|
|
|
|
|
padding-bottom:160rpx;
|
|
|
|
|
padding-bottom: 160rpx;
|
|
|
|
|
|
|
|
|
|
.myswiper {
|
|
|
|
|
// padding: 40rpx;
|
|
|
|
|
}
|
|
|
|
|
@ -531,7 +538,7 @@
|
|
|
|
|
text-align: center;
|
|
|
|
|
/* justify-content: space-around; */
|
|
|
|
|
padding: 10rpx;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|