Browse Source

商户二维码、非遗板块更新

dev
chenkainan 4 months ago
parent
commit
5747c74483
  1. 2
      manifest.json
  2. 7
      pages.json
  3. 4
      pages/index/index.vue
  4. 3
      pages/login/login.vue
  5. 31
      subPackages/other/feiyi.vue
  6. 109
      subPackages/webPage/webPages.vue

2
manifest.json

@ -69,7 +69,7 @@
"desc" : "给用户展示地图"
}
},
"requiredPrivateInfos" : [ "getLocation" ]
"requiredPrivateInfos" : [ "getLocation", "onLocationChange", "startLocationUpdate" ]
},
"mp-alipay" : {
"usingComponents" : true

7
pages.json

@ -173,6 +173,13 @@
"enablePullDownRefresh" : false
}
},
{
"path": "webPage/webPages",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path" : "video/video",
"style" : {

4
pages/index/index.vue

@ -299,8 +299,8 @@
this.Post({
id: 4
},'/api/article/getArticleById').then(res => {
this.isShow = res.data.subtitle == 1 ? true : false
// this.isShow = res.data.address == 1 ? true : false
// this.isShow = res.data.subtitle == 1 ? true : false
this.isShow = res.data.address == 1 ? true : false
})
},
onReady() {

3
pages/login/login.vue

@ -91,7 +91,8 @@
userInfo: res.userInfo,
encryptedData: res.encryptedData,
iv: res.iv,
wechat_qrcode: uni.getStorageSync('wechat_qrcode')?uni.getStorageSync('wechat_qrcode'):''
wechat_qrcode: uni.getStorageSync('wechat_qrcode')?uni.getStorageSync('wechat_qrcode'):'',
merchant_id: uni.getStorageSync("merchant_id") ? uni.getStorageSync("merchant_id") : ''
}, '/api/mini_program/login').then(resTwo => {
_this.$store.commit('changeUserInfo', resTwo.data.userinfo)
if(resTwo.data.userinfo.mobile){

31
subPackages/other/feiyi.vue

@ -65,8 +65,9 @@
list: []
}],
first: 0,
count: 10,
count: 2,
xwwfind: 0,
cateLevel:'',
djlist: [{
name: '全部',
ind: 0,
@ -93,12 +94,11 @@
list: []
}
],
djName: '',
tjyrDatas: []
}
},
onReachBottom() {
this.first += 10;
this.first += 2;
this.getDatalist();
},
onPageScroll(e) {
@ -110,6 +110,7 @@
}
},
onReady() {
this.TitleClick(1);
var that = this;
const query = uni.createSelectorQuery().in(this);
query.select('#lmid').boundingClientRect(data => {
@ -117,15 +118,22 @@
}).exec();
},
mounted() {
this.TitleClick(1);
// this.TitleClick(1);
},
methods: {
ckxwwfind(ind,el) {
this.xwwfind = ind;
if(el.name != '全部') {
this.cateLevel = el.name;
}else{
this.cateLevel = '';
}
if(this.titleInd == 1) {
this.djlist[this.xwwfind].list = [];
this.first = 0;
this.count = 2;
this.getDatalist();
}else if(this.titleInd == 2) {
this.djName = el.name;
this.getfyyrDaya();
}
},
@ -141,16 +149,19 @@
}
},
getDatalist() {
uni.showLoading({title: '加载中...'});
// uni.showLoading({title: '...'});
uni.showToast({title: '加载中...',duration: 1000,icon: 'none'});
var url = '/json/content_list.jspx';
var para = {};
var that = this;
that.Post({
let data = {
apiType: 'old',
channelIds: that.id,
first: that.first,
count: that.count
}, url).then(res => {
}
if(that.cateLevel != '') data.cateLevel = that.cateLevel
that.Post(data, url).then(res => {
if(res) {
var json = [];
json = res;
@ -228,11 +239,11 @@
if (res.data.success) {
let json = res.data.obj.data;
that.tjyrDatas = [];
if(that.djName == '') {
if(that.cateLevel == '') {
that.tjyrDatas = json;
}else{
for (let i = 0; i < json.length; i++) {
if(json[i].level == that.djName) {
if(json[i].level == that.cateLevel) {
that.tjyrDatas.push(json[i])
}
}

109
subPackages/webPage/webPages.vue

@ -0,0 +1,109 @@
<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: '',
saveUrl: '',
}
},
onLoad(option) {
if(option && option.scene) {
const scene = decodeURIComponent(option.scene);
console.log('scene', scene)
uni.setStorageSync("merchant_id", scene)
}
let that = this
this.Post({
type: 'webView',
},
'/api/public_service/getKumgangHeadImgList'
).then(res => {
let url = res.data[0].title
console.log(url)
if (url.toLowerCase().indexOf('m.cloud.sz-trip.com') >= 0) {
this.handleJDSZ(url)
setTimeout(() => {
that.saveUrl = url
}, 500)
} else {
this.url = url
this.saveUrl = url
console.log(111,this.url)
}
});
},
onShow() {
//
this.Post({
merchant_id: uni.getStorageSync("merchant_id") || ''
}, '/api/mini_program/recordQrCodeScan').then(res => {})
console.log(this.url, this.saveUrl, 'onshow')
if (!this.url && this.saveUrl) {
let param = this.getUrlParam(this.saveUrl)
console.log(param)
this.checkIsLoginJdsz().then(res => {
if (res) {
param.token = res
param.platform = 'changshu'
let baseUrl = param.tempUrl
let queryString = Object.entries(param).filter(v => v[0] != 'tempUrl')
.map(([key, value]) => `${(key)}=${(value)}`)
.join('&');
const fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
}
})
}
},
methods: {
handleJDSZ(url) {
let param = this.getUrlParam(url)
console.log(param)
this.checkIsLoginJdsz().then(res => {
if (res) {
param.token = res
param.platform = 'changshu'
let baseUrl = param.tempUrl
let queryString = Object.entries(param).filter(v => v[0] != 'tempUrl')
.map(([key, value]) => `${(key)}=${(value)}`)
.join('&');
const fullUrl = `${baseUrl}?${queryString}`;
console.log(fullUrl);
this.url = fullUrl
}
}).finally(() => {
this.saveUrl = url
})
},
getUrlParam(url) {
var theParam = {
tempUrl: url
};
let searchStartIndex = url.indexOf("?")
if (searchStartIndex >= 0) {
theParam.tempUrl = url.substring(0, searchStartIndex);
var strs = url.substring(searchStartIndex + 1);
strs = strs.split("&"); //&[1=xx,2=xx,3=xx,...]
for (var i = 0; i < strs.length; i++) { //
theParam[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
}
}
return theParam; //
}
},
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save