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

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

parent 5c3d38ea
// const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地/址
// const baseUrl = 'http://5thcg5.natappfree.cc'; // 开发地址
const baseUrl = 'https://movecar.jd.com'; // 线上地址
// const baseUrl = 'http://192.168.0.107:8080'; // 线上地址
const httpRequest = (opts, data) => {
let httpDefaultOpts = {
url: baseUrl + opts.url,
......
......@@ -3,8 +3,9 @@ import request from "./request";
// let baseUrl = 'https://jdorder.uzosp.com/'; // 正式服务域名接口
// let baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地/址
let baseUrl = 'https://movecar.jd.com'; // 测试服务域名接口
// let baseUrl = 'http://192.168.0.107:8080'; // 测试服务域名接口
//可以new多个request来支持多个域名请求
......
......@@ -6,6 +6,7 @@ Vue.prototype.$store = store;
import http from "./common/api/api.js"
import $http from '@/common/request/requestConfig';
import {goToLocation} from '@/utils/utils.js'
Vue.config.productionTip = false
import ActiveForm from "@/common/active-form/active-form";
......@@ -13,6 +14,7 @@ import scrollList from "@/common/scroll-list/scroll-list";
Vue.use(uView);
Vue.prototype.http = http
Vue.prototype.$http = $http
Vue.prototype.$goToLocation = goToLocation
// 订阅消息模板id
Vue.prototype.nc_templateid = '59-hfHg3CnDvgVEnjqxiHRFwpABehc5lZxHQeUctlrg'
......
This diff is collapsed.
......@@ -364,19 +364,11 @@
})
}
// 判断是否有京东跳转
let jdNavto = uni.getStorageSync('jdNavto')
let jdNavToObj = uni.getStorageSync('jdNavToObj')
if(jdNavto){
let url;
if(jdNavto == 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})
uni.removeStorageSync('jdNavto')
if(jdNavToObj){
uni.removeStorageSync('jdNavToObj')
this.$goToLocation(item)
}
}
......
......@@ -73,11 +73,11 @@
},
getRotationList() {
let opts = {
url: '/app/index/carouse/3',
url: '/app/index/adv/1',
method: 'get'
};
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 = []
data = res.data.data
let imgList = []
......@@ -92,28 +92,7 @@
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
let link = item.link;
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
})
}
this.$goToLocation(item)
},
goUrl(vo) {
uni.removeStorageSync('routerLogin')
......
......@@ -146,11 +146,11 @@
},
getRotationList() {
let opts = {
url: '/app/index/carouse/4',
url: '/app/index/adv/2',
method: 'get'
};
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 = []
data = res.data.data
let imgList = []
......@@ -165,28 +165,7 @@
// 轮播跳转其他页面
goOtherLink(index) {
let item = this.list5[index]
let link = item.link;
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
})
}
this.$goToLocation(item)
},
loginOut() {
this.$http.request({
......
......@@ -19,7 +19,7 @@
<image :src="getImage(vo.mainImgUrl)" />
</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>
......@@ -34,8 +34,8 @@
{{vo.title}}
</view>
<view class="one_item_price">
{{vo.currentPrice/100}}<text style="font-size: 22rpx;margin-right:4rpx;"></text>
<span class="num__two">{{vo.originalPrice/100}}</span>
{{vo.currentPrice/100}}<text v-if="vo.priceSuffixFlag" style="font-size: 22rpx;margin-right:4rpx;"></text>
<span class="num__two" v-if="vo.originalPrice && vo.originalPrice > 0">{{vo.originalPrice/100}}</span>
</view>
</view>
</view>
......@@ -191,27 +191,7 @@ export default {
// 轮播跳转其他页面
goOtherLink(index){
let item = this.list3[index]
let link = item.link;
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
})
}
this.$goToLocation(item)
}
},
onReady: function () {
......@@ -281,7 +261,7 @@ export default {
}
.one_item_price {
font-size: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #E1251B;
......@@ -374,7 +354,7 @@ export default {
}
.item2__price {
font-size: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #E1251B;
......
......@@ -66,7 +66,18 @@
<u-action-sheet :actions="list" @close='close' @select="selectClick" closeOnClickOverlay round='6'
:show="show"></u-action-sheet>
</div>
</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>
</view>
</template>
<script>
......@@ -120,10 +131,39 @@
notAllowPhoneReason: '',
notAllowWechatReason: '',
},
wxMaxNum:""
wxMaxNum:"",
list5: [],
current: 0,
carouselFlag:false,
}
},
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() {
uni.navigateTo({
url: '/pages/main'
......@@ -399,6 +439,7 @@
this.moveCode = e.scene
//console.log('scene: ' + scene);
}
this.getRotationList()
},
onShow() {
this.getCarNumber()
......
......@@ -95,6 +95,17 @@
</view>
<!-- <view class="use__text" @click="gotoExplanation">使用说明</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">
......@@ -171,10 +182,39 @@ export default {
}, // 验证码
clickStatus:false, // 节流
key:null, // 加密key
iv:null // 加密iv
iv:null, // 加密iv
list5: [],
current: 0,
carouselFlag:false,
}
},
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() {
this.checked = !this.checked;
},
......@@ -424,6 +464,7 @@ export default {
onLoad(option) {
this.moveCode = option.moveCode
this.getKey()
this.getRotationList()
}
}
</script>
......
......@@ -24,7 +24,7 @@
</div>
<div class="money__num">
<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>
......
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