Commit 83306b5e by LJM

js

parent f9ce10cc
...@@ -19,8 +19,8 @@ export default { ...@@ -19,8 +19,8 @@ export default {
uni-page-head { uni-page-head {
display: none; display: none;
} }
body{ body {
background: #f5f5f5; background: #f5f5f5;
} }
/* #endif */ /* #endif */
</style> </style>
import App from './App' import App from './App'
import { request} from '@/util/util.js' import { request } from '@/util/util.js'
import filters from '@/filters' import filters from '@/filters'
import router from '@/router/index.js' import router from '@/router/index.js'
import { RouterMount } from 'uni-simple-router' import { RouterMount } from 'uni-simple-router'
import directive from '@/directive' import directive from '@/directive'
import { Ichunt_Api } from '@/util/api.js';
// #ifndef VUE3 // #ifndef VUE3
import Vue from 'vue' import Vue from 'vue'
...@@ -18,16 +20,23 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key])); ...@@ -18,16 +20,23 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
//自定义指令 //自定义指令
Vue.use(directive); Vue.use(directive);
//定义全局变量
var globalData = {
kefu: '' //客服
};
//读取全局变量配置
request(Ichunt_Api + '/api/common/data', 'GET', {}, true, true).then(res => {
if (res.err_code === 0) {
globalData.kefu = res.data.kfqq_xk.data;
Vue.prototype.$globalData = globalData;
}
});
try { try {
function isPromise(obj) { function isPromise(obj) {
return ( return (!!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function");
!!obj &&
(typeof obj === "object" || typeof obj === "function") &&
typeof obj.then === "function"
);
} }
// 统一 vue2 API Promise 化返回格式与 vue3 保持一致 // 统一 vue2 API Promise 化返回格式与 vue3 保持一致
......
<template> <template>
<view class="page-userOrder"> <view class="page-userOrder">
<drag-button-follow follow="left,right" className="drag-button" class="drag-button" :url="kfurl"></drag-button-follow> <drag-button-follow follow="left,right" className="drag-button" class="drag-button"></drag-button-follow>
<view class="top"> <view class="top">
<view class="head row bothSide verCenter"> <view class="head row bothSide verCenter">
<view class="left row verCenter"> <view class="left row verCenter">
...@@ -154,7 +154,6 @@ export default { ...@@ -154,7 +154,6 @@ export default {
}); });
return { return {
time: currentDate, time: currentDate,
kfurl: 'https://url.cn/uia2no5Z?_type=wpa&amp;qidian=true',
arr: ['全部', '待付款', '待收货', '已完结订单'], arr: ['全部', '待付款', '待收货', '已完结订单'],
curr: 0, curr: 0,
list: [], list: [],
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<text class="tt">我的优惠券</text> <text class="tt">我的优惠券</text>
<text class="tip"></text> <text class="tip"></text>
</navigator> </navigator>
<a class="box column rowCenter verCenter" :href="userInfo.kefu_url"> <a class="box column rowCenter verCenter" :href="kfqq_xk">
<image src="../../static/qq.png"></image> <image src="../../static/qq.png"></image>
<text class="tt">我的客服</text> <text class="tt">我的客服</text>
</a> </a>
...@@ -120,12 +120,14 @@ export default { ...@@ -120,12 +120,14 @@ export default {
}, },
data() { data() {
return { return {
kfqq_xk: '',
userInfo: {}, userInfo: {},
activity_list: [] activity_list: []
}; };
}, },
onShow() { onShow() {
this.getData(); this.getData();
this.kfqq_xk = this.$globalData.kefu;
}, },
methods: { methods: {
/** /**
...@@ -315,6 +317,7 @@ export default { ...@@ -315,6 +317,7 @@ export default {
this.request(Api_Url + '/user/getUserType', 'POST', {}, true, true).then(res => { this.request(Api_Url + '/user/getUserType', 'POST', {}, true, true).then(res => {
if (res.err_code === 0) { if (res.err_code === 0) {
this.userInfo = res.data; this.userInfo = res.data;
this.$globalData.kefu = res.data.kefu_url;
} else if (res.err_code === 11012) { } else if (res.err_code === 11012) {
uni.navigateTo({ uni.navigateTo({
url: '/login' url: '/login'
......
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 sign in to comment