Commit 1a86080f authored by 肖健's avatar 肖健

小程序首页悬浮更改为动态、首页商品更改为动态、首页增加视频播放、新增小程序广告

parent 5c3d38ea
// const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地/址 // const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地/址
// const baseUrl = 'http://5thcg5.natappfree.cc'; // 开发地址 // const baseUrl = 'http://5thcg5.natappfree.cc'; // 开发地址
const baseUrl = 'https://movecar.jd.com'; // 线上地址 const baseUrl = 'https://movecar.jd.com'; // 线上地址
// const baseUrl = 'http://192.168.0.107:8080'; // 线上地址
const httpRequest = (opts, data) => { const httpRequest = (opts, data) => {
let httpDefaultOpts = { let httpDefaultOpts = {
url: baseUrl + opts.url, url: baseUrl + opts.url,
......
...@@ -3,8 +3,9 @@ import request from "./request"; ...@@ -3,8 +3,9 @@ import request from "./request";
// let baseUrl = 'https://jdorder.uzosp.com/'; // 正式服务域名接口 // let baseUrl = 'https://jdorder.uzosp.com/'; // 正式服务域名接口
// let baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地/址
let baseUrl = 'https://movecar.jd.com'; // 测试服务域名接口 let baseUrl = 'https://movecar.jd.com'; // 测试服务域名接口
// let baseUrl = 'http://192.168.0.107:8080'; // 测试服务域名接口
//可以new多个request来支持多个域名请求 //可以new多个request来支持多个域名请求
......
...@@ -6,6 +6,7 @@ Vue.prototype.$store = store; ...@@ -6,6 +6,7 @@ Vue.prototype.$store = store;
import http from "./common/api/api.js" import http from "./common/api/api.js"
import $http from '@/common/request/requestConfig'; import $http from '@/common/request/requestConfig';
import {goToLocation} from '@/utils/utils.js'
Vue.config.productionTip = false Vue.config.productionTip = false
import ActiveForm from "@/common/active-form/active-form"; import ActiveForm from "@/common/active-form/active-form";
...@@ -13,6 +14,7 @@ import scrollList from "@/common/scroll-list/scroll-list"; ...@@ -13,6 +14,7 @@ import scrollList from "@/common/scroll-list/scroll-list";
Vue.use(uView); Vue.use(uView);
Vue.prototype.http = http Vue.prototype.http = http
Vue.prototype.$http = $http Vue.prototype.$http = $http
Vue.prototype.$goToLocation = goToLocation
// 订阅消息模板id // 订阅消息模板id
Vue.prototype.nc_templateid = '59-hfHg3CnDvgVEnjqxiHRFwpABehc5lZxHQeUctlrg' Vue.prototype.nc_templateid = '59-hfHg3CnDvgVEnjqxiHRFwpABehc5lZxHQeUctlrg'
......
...@@ -18,38 +18,60 @@ ...@@ -18,38 +18,60 @@
</view> </view>
<view class="banner"> <view class="banner">
<view class="banner-img"> <view :class="indexCommodityList.length == 2 ? 'banner-bg' : 'banner-bg banner-bg-1'" v-if="indexCommodityList && indexCommodityList.length <= 2">
<image src="http://jdnc-oss.uzosp.com/2022/06/23/d868a11f485448efb960d436a2159d78.png"></image> <image src="http://jdnc-oss.uzosp.com/2022/12/28/b1679b5da1b84fa1827039fe4fadd91c.png"></image>
<view class="left" @click="goJdShop(1)"> <view class="item" @click="goJdShop(item)" v-for="(item, i) in indexCommodityList" :key="i">
<image :src="item.mainImgUrl"></image>
<view class="banner-btn-bg">
<view class="banner-btn"> <view class="banner-btn">
<image src="../static/index/ban-btn.png"></image> <image src="../static/index/ban-btn.png"></image>
<text>立即购买</text> <text>立即购买</text>
</view> </view>
</view> </view>
<view class="right" @click="goJdShop(2)"> </view>
</view>
<view v-else>
<view scroll-x="true" class="banner-bg">
<image src="http://jdnc-oss.uzosp.com/2022/12/28/b1679b5da1b84fa1827039fe4fadd91c.png"></image>
<scroll-view :scroll-x="true" :enable-flex="true" :show-scrollbar="false" :scroll-with-animation="true" style="width:100%;white-space: nowrap;">
<view class="item" style="display: inline-flex;margin-right: 15rpx;" @click="goJdShop(item)" v-for="(item, i) in indexCommodityList" :key="i">
<image :src="item.mainImgUrl"></image>
<view class="banner-btn-bg">
<view class="banner-btn"> <view class="banner-btn">
<image src="../static/index/ban-btn.png"></image> <image src="../static/index/ban-btn.png"></image>
<text>立即购买</text> <text>立即购买</text>
</view> </view>
</view> </view>
</view> </view>
<view class="banner-other"> </scroll-view>
<view @click="goShopH5(2)">
<image src="https://nuoche.s3.cn-north-1.jdcloud-oss.com/2022/10/14/eb67b0d88bd24f71a04b6a939ef3bf74.png"></image>
</view> </view>
<view @click="goShopH5(1)">
<image src="https://nuoche.s3.cn-north-1.jdcloud-oss.com/2022/10/14/672f38dadb0f4eacb486af28fe4fe762.png"></image>
</view> </view>
<view class="banner-other" v-if="levitationList && levitationList.length > 0">
<view v-for="(item, i) in levitationList" :key="i" @click="$goToLocation(item)">
<view v-if="i !== 0" style="margin-top: 50rpx;">
<u--image :src="item.imageUrl" width="160rpx" height="120rpx"></u--image>
</view> </view>
<u-gap bgColor="transparent" height="20"></u-gap> <view v-else>
<u--image :src="item.imageUrl" width="160rpx" height="120rpx"></u--image>
</view> </view>
</view> </view>
</view>
<u-gap bgColor="transparent" height="20"></u-gap>
</view>
</view>
<!-- bg-img2为视频播放 -->
<view class="bg-img"> <view class="bg-img2" v-if="videoObj">
<image src="http://jdnc-oss.uzosp.com/2022/12/27/6a1ef562576f4e86a98118c9e343b9da.png"></image>
<video id="myvideo" @fullscreenchange="screenChange" :src="videoObj.videoLink" :poster="videoObj.thumbnail" controls>
</video>
</view>
<!-- bg-img没有视频播放,纯图片 -->
<view class="bg-img" v-else>
<image src="http://jdnc-oss.uzosp.com/2022/06/15/079440f5eea541bba67ea3d5f8097162.png"></image> <image src="http://jdnc-oss.uzosp.com/2022/06/15/079440f5eea541bba67ea3d5f8097162.png"></image>
</view> </view>
...@@ -95,39 +117,23 @@ ...@@ -95,39 +117,23 @@
timerNum:3, timerNum:3,
timer:null, timer:null,
clickState:false, // 立即领取 防抖 clickState:false, // 立即领取 防抖
videoObj: null, //视频对象
videoContext: null,
levitationList: [],//悬浮数组对象
indexCommodityList: [],
}; };
}, },
methods: { methods: {
goShopH5(index){ screenChange(e) {
let token = uni.getStorageSync('userToken'); if (!e.detail.fullScreen) {
if (!token) { this.videoContext.stop()
uni.setStorageSync('jdNavto',index)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
let url;
if(index == 1){
url = 'https://pro.m.jd.com/mall/active/3L2hs3R3aibYmosCRzA2Rp5z8pTR/index.html?babelChannel=ttt1'
}else{
url = 'https://jarvis.m.jd.com/start?source=2'
} }
// uni.setStorageSync('h5url',url)
util.navigateToH5({page:url})
}, },
// 跳转 其他小程序页面 // 跳转 其他小程序页面
goJdShop(index){ goJdShop(d){
let sku;
if(index == 1){
sku = 100025676633
}else{
sku = 100025676611
}
console.log(sku,777777777)
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id appId: 'wx91d27dbf599dff74', // 跳转目标小程序的id
path: 'pages/item/detail/detail?sku='+sku, // 目标小程序的页面路径 path: d.link, // 目标小程序的页面路径
extraData: { // 需要携带的参数 extraData: { // 需要携带的参数
}, },
...@@ -288,31 +294,55 @@ ...@@ -288,31 +294,55 @@
} }
}) })
}, },
// 轮播跳转其他页面 async getVideoList() {
goOtherLink(index) { await this.$http.request({
let item = this.list5[index] url:'/app/index/video/1',
let link = item.link; method:'get',
if(link) { data:{
if (item.remark == 'jdh5') {
// uni.navigateTo({ },
// url: '/pages/webview/webview?url=' + link }).then(res => {
// }) if(res && res.length > 0) {
let url; this.videoObj = res[0]
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
} }
util.navigateToH5({page:link}) })
return },
getVideoList() {
this.$http.request({
url:'/app/index/levitation/1',
method:'get',
data:{
},
}).then(res => {
if(res && res.length > 0) {
this.levitationList = res
} else {
this.levitationList = []
} }
uni.navigateTo({
url: link
}) })
},
//获取首页商品
getIndexCommodityList() {
this.$http.request({
url:'/app/index/mall/index',
method:'get',
data:{
},
}).then(res => {
if(res && res.length > 0) {
this.indexCommodityList = res
} else {
this.indexCommodityList = []
} }
})
},
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
this.$goToLocation(item)
}, },
// 获取爱车列表 // 获取爱车列表
getCarList(){ getCarList(){
...@@ -351,6 +381,8 @@ ...@@ -351,6 +381,8 @@
created() { created() {
this.getMoveCode() this.getMoveCode()
this.getRotationList() this.getRotationList()
this.getVideoList()
this.getIndexCommodityList()
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
...@@ -361,6 +393,11 @@ ...@@ -361,6 +393,11 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '京东汽车挪车牌' title: '京东汽车挪车牌'
}); });
// 获取 video 上下文 videoContext 对象
this.videoContext = uni.createVideoContext('myvideo')
// 进入全屏状态
this.videoContext.requestFullScreen()
} }
}; };
</script> </script>
...@@ -435,10 +472,8 @@ ...@@ -435,10 +472,8 @@
width:100%; width:100%;
margin-top:70rpx; margin-top:70rpx;
position: relative; position: relative;
.banner-img, .banner-bg,
.banner-btn{ .banner-btn{
margin: 0 auto;
position: relative;
image{ image{
position: absolute; position: absolute;
top:0;left:0; top:0;left:0;
...@@ -448,19 +483,21 @@ ...@@ -448,19 +483,21 @@
position: relative; position: relative;
} }
} }
.banner-img{ .banner-btn-bg {
display: flex;
justify-content: center;
width: 100%;
}
.banner-bg{
width: 710rpx ;height:542rpx; width: 710rpx ;height:542rpx;
box-sizing: border-box; box-sizing: border-box;
padding:100rpx 80rpx 0; padding:100rpx 80rpx 0;
display:flex; display:flex;
justify-content: space-between; justify-content: space-between;
.left{ .item {
width: 260rpx;height:360rpx; width:268rpx;
height:366rpx;
} }
.right{
width: 260rpx;height:360rpx;
}
>view{
.banner-btn{ .banner-btn{
width:200rpx;height:66rpx; width:200rpx;height:66rpx;
font-weight: bold; font-weight: bold;
...@@ -471,33 +508,39 @@ ...@@ -471,33 +508,39 @@
line-height:66rpx; line-height:66rpx;
} }
} }
.banner-bg-1 {
justify-content: center;
} }
.banner-other{ .banner-other{
position: absolute; position: absolute;
right:-22rpx;top:-80rpx; right:-22rpx;top:-80rpx;
z-index:100; z-index:100;
>view{
&:first-child{
margin-left:34rpx;
width: 120rpx;height:112rpx;
} }
&:last-child{
margin-top:100rpx;
width: 172rpx;height:140rpx;
} }
.bg-img{
width:750rpx;
image{ image{
width:100%;height:100%; width:750rpx;height:4420rpx;
}
} }
} }
} .bg-img2{
width:750rpx;
.bg-img{ position: relative;
width:100%; display: flex;
align-items: center;
justify-content: center;
image{ image{
width:100%;height:4420rpx; width:750rpx;height:4959rpx;
}
video {
position: absolute;
top: 660rpx;
width: 620rpx;
height: 310rpx;
} }
} }
......
...@@ -364,19 +364,11 @@ ...@@ -364,19 +364,11 @@
}) })
} }
// 判断是否有京东跳转 // 判断是否有京东跳转
let jdNavto = uni.getStorageSync('jdNavto') let jdNavToObj = uni.getStorageSync('jdNavToObj')
if(jdNavto){ if(jdNavToObj){
let url; uni.removeStorageSync('jdNavToObj')
if(jdNavto == 1){ this.$goToLocation(item)
url = 'https://pro.m.jd.com/mall/active/3L2hs3R3aibYmosCRzA2Rp5z8pTR/index.html?babelChannel=ttt1'
}else{
url = 'https://jarvis.m.jd.com/start?source=2'
}
// uni.setStorageSync('h5url',url)
util.navigateToH5({page:url})
uni.removeStorageSync('jdNavto')
} }
} }
......
...@@ -73,11 +73,11 @@ ...@@ -73,11 +73,11 @@
}, },
getRotationList() { getRotationList() {
let opts = { let opts = {
url: '/app/index/carouse/3', url: '/app/index/adv/1',
method: 'get' method: 'get'
}; };
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200 && res.data.data && res.data.data.length > 0) {
let data = [] let data = []
data = res.data.data data = res.data.data
let imgList = [] let imgList = []
...@@ -92,28 +92,7 @@ ...@@ -92,28 +92,7 @@
// 轮播跳转其他页面 // 轮播跳转其他页面
goOtherLink(index) { goOtherLink(index) {
let item = this.list5[index] let item = this.list5[index]
let link = item.link; this.$goToLocation(item)
if(link) {
if (item.remark == 'jdh5') {
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// })
let url;
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
util.navigateToH5({page:link})
return
}
uni.navigateTo({
url: link
})
}
}, },
goUrl(vo) { goUrl(vo) {
uni.removeStorageSync('routerLogin') uni.removeStorageSync('routerLogin')
......
...@@ -146,11 +146,11 @@ ...@@ -146,11 +146,11 @@
}, },
getRotationList() { getRotationList() {
let opts = { let opts = {
url: '/app/index/carouse/4', url: '/app/index/adv/2',
method: 'get' method: 'get'
}; };
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200 && res.data.data && res.data.data.length > 0) {
let data = [] let data = []
data = res.data.data data = res.data.data
let imgList = [] let imgList = []
...@@ -165,28 +165,7 @@ ...@@ -165,28 +165,7 @@
// 轮播跳转其他页面 // 轮播跳转其他页面
goOtherLink(index) { goOtherLink(index) {
let item = this.list5[index] let item = this.list5[index]
let link = item.link; this.$goToLocation(item)
if(link) {
if (item.remark == 'jdh5') {
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// })
let url;
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
util.navigateToH5({page:link})
return
}
uni.navigateTo({
url: link
})
}
}, },
loginOut() { loginOut() {
this.$http.request({ this.$http.request({
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<image :src="getImage(vo.mainImgUrl)" /> <image :src="getImage(vo.mainImgUrl)" />
</view> </view>
<view class="item2__title">{{vo.title}}</view> <view class="item2__title">{{vo.title}}</view>
<view class="item2__price">{{vo.currentPrice/100}}<text style="font-size: 22rpx;"></text></view> <view class="item2__price">{{vo.currentPrice/100}}<text v-if="vo.priceSuffixFlag" style="font-size: 22rpx;"></text></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
{{vo.title}} {{vo.title}}
</view> </view>
<view class="one_item_price"> <view class="one_item_price">
{{vo.currentPrice/100}}<text style="font-size: 22rpx;margin-right:4rpx;"></text> {{vo.currentPrice/100}}<text v-if="vo.priceSuffixFlag" style="font-size: 22rpx;margin-right:4rpx;"></text>
<span class="num__two">{{vo.originalPrice/100}}</span> <span class="num__two" v-if="vo.originalPrice && vo.originalPrice > 0">{{vo.originalPrice/100}}</span>
</view> </view>
</view> </view>
</view> </view>
...@@ -191,27 +191,7 @@ export default { ...@@ -191,27 +191,7 @@ export default {
// 轮播跳转其他页面 // 轮播跳转其他页面
goOtherLink(index){ goOtherLink(index){
let item = this.list3[index] let item = this.list3[index]
let link = item.link; this.$goToLocation(item)
if(link) {
if (item.remark == 'jdh5') {
// uni.navigateTo({
// url: '/pages/webview/webview?url=' + link
// })
let token = uni.getStorageSync('userToken');
if (!token) {
uni.setStorageSync('jdNavto',1)
uni.navigateTo({
url: '/pages/login/index/index'
})
return;
}
util.navigateToH5({page:link})
return
}
uni.navigateTo({
url: link
})
}
} }
}, },
onReady: function () { onReady: function () {
...@@ -281,7 +261,7 @@ export default { ...@@ -281,7 +261,7 @@ export default {
} }
.one_item_price { .one_item_price {
font-size: 24rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #E1251B; color: #E1251B;
...@@ -374,7 +354,7 @@ export default { ...@@ -374,7 +354,7 @@ export default {
} }
.item2__price { .item2__price {
font-size: 24rpx; font-size: 26rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #E1251B; color: #E1251B;
......
...@@ -66,6 +66,17 @@ ...@@ -66,6 +66,17 @@
<u-action-sheet :actions="list" @close='close' @select="selectClick" closeOnClickOverlay round='6' <u-action-sheet :actions="list" @close='close' @select="selectClick" closeOnClickOverlay round='6'
:show="show"></u-action-sheet> :show="show"></u-action-sheet>
</div> </div>
<u-gap bgColor="transparent" v-if="carouselFlag" height="20"></u-gap>
<view v-if="carouselFlag" style="width: 700rpx;margin: 0 auto;position: relative;">
<u-swiper radius="12rpx" :height="120" :list="list5" circular @change="e => current = e.current"
:autoplay="true" keyName="imageUrl" @click="goOtherLink">
</u-swiper>
<view style="position: absolute;right: 10rpx; top:10rpx;z-index: 99999;">
<u--image src="/static/my/close.png" width="12px" height="12px" @click="closeCarouselFlag"></u--image>
</view>
</view>
</view> </view>
</template> </template>
...@@ -120,10 +131,39 @@ ...@@ -120,10 +131,39 @@
notAllowPhoneReason: '', notAllowPhoneReason: '',
notAllowWechatReason: '', notAllowWechatReason: '',
}, },
wxMaxNum:"" wxMaxNum:"",
list5: [],
current: 0,
carouselFlag:false,
} }
}, },
methods: { methods: {
closeCarouselFlag() {
this.carouselFlag = false
},
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
this.$goToLocation(item)
},
getRotationList() {
let opts = {
url: '/app/index/adv/4',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200 && res.data.data && res.data.data.length > 0) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e)
})
this.list5 = imgList
this.carouselFlag = true
}
})
},
goToIndex() { goToIndex() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/main' url: '/pages/main'
...@@ -399,6 +439,7 @@ ...@@ -399,6 +439,7 @@
this.moveCode = e.scene this.moveCode = e.scene
//console.log('scene: ' + scene); //console.log('scene: ' + scene);
} }
this.getRotationList()
}, },
onShow() { onShow() {
this.getCarNumber() this.getCarNumber()
......
...@@ -96,6 +96,17 @@ ...@@ -96,6 +96,17 @@
<!-- <view class="use__text" @click="gotoExplanation">使用说明</view> --> <!-- <view class="use__text" @click="gotoExplanation">使用说明</view> -->
<view class="use__text" @click="goArticle(2)">挪车牌使用安全说明</view> <view class="use__text" @click="goArticle(2)">挪车牌使用安全说明</view>
<u-gap bgColor="transparent" v-if="carouselFlag" height="20"></u-gap>
<view v-if="carouselFlag" style="width: 700rpx;margin: 0 auto;position: relative;">
<u-swiper radius="12rpx" :height="120" :list="list5" circular @change="e => current = e.current"
:autoplay="true" keyName="imageUrl" @click="goOtherLink">
</u-swiper>
<view style="position: absolute;right: 10rpx; top:10rpx;z-index: 99999;">
<u--image src="/static/my/close.png" width="12px" height="12px" @click="closeCarouselFlag"></u--image>
</view>
</view>
<!-- 爱车选择弹框 --> <!-- 爱车选择弹框 -->
<u-popup :show="selectCar" mode="bottom" round="10" @close="selectCar = false"> <u-popup :show="selectCar" mode="bottom" round="10" @close="selectCar = false">
<view class="love_car_list"> <view class="love_car_list">
...@@ -171,10 +182,39 @@ export default { ...@@ -171,10 +182,39 @@ export default {
}, // 验证码 }, // 验证码
clickStatus:false, // 节流 clickStatus:false, // 节流
key:null, // 加密key key:null, // 加密key
iv:null // 加密iv iv:null, // 加密iv
list5: [],
current: 0,
carouselFlag:false,
} }
}, },
methods: { methods: {
closeCarouselFlag() {
this.carouselFlag = false
},
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
this.$goToLocation(item)
},
getRotationList() {
let opts = {
url: '/app/index/adv/3',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200 && res.data.data && res.data.data.length > 0) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e => {
imgList.push(e)
})
this.list5 = imgList
this.carouselFlag = true
}
})
},
changeBtn() { changeBtn() {
this.checked = !this.checked; this.checked = !this.checked;
}, },
...@@ -424,6 +464,7 @@ export default { ...@@ -424,6 +464,7 @@ export default {
onLoad(option) { onLoad(option) {
this.moveCode = option.moveCode this.moveCode = option.moveCode
this.getKey() this.getKey()
this.getRotationList()
} }
} }
</script> </script>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
<div class="money__num"> <div class="money__num">
<text class="num__one">¥{{vo.currentPrice/100}}</text> <text class="num__one">¥{{vo.currentPrice/100}}</text>
<text class="num__two">¥{{vo.originalPrice/100}}</text> <text class="num__two" v-if="vo.originalPrice && vo.originalPrice > 0">¥{{vo.originalPrice/100}}</text>
</div> </div>
</div> </div>
</div> </div>
......
import util from '@/pages/login/util.js'
export function goToLocation(item) {
let token = uni.getStorageSync('userToken')
if (!token) {
uni.setStorageSync('jdNavToObj', item)
uni.navigateTo({
url: '/pages/login/index/index'
})
return
}
let url
//H5链接,判断链接是否设置
if(item.busType == 1 && item.link){
util.navigateToH5({page:url})
}
//小程序链接,需要判断链接和appId是否都设置
if(item.busType == 2 && item.appId != null && item.link){
uni.navigateToMiniProgram({
appId: item.appId, // 跳转目标小程序的id
path: item.link, // 目标小程序的页面路径
extraData: { // 需要携带的参数
},
success:(res)=> {
// 打开成功
},
fail:()=>{
}
})
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment