diff --git a/config.js b/config.js index d6bf89e..844b6c6 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ // 应用全局配置 module.exports = { - baseUrl: 'http://192.168.1.4:8080', + baseUrl: 'http://192.168.1.17:8080', // baseUrl: 'http://localhost:8080', // 应用信息 appInfo: { diff --git a/pages/index.vue b/pages/index.vue index 332dfa5..24157ab 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -25,6 +25,13 @@ import subscribe from '@/pages/components/subscribe.vue' import mineIndex from '@/pages/mine/mine-index.vue' import myNotice from '@/pages/components/my-notice.vue' + import { + getSiteConfig + } from '@/api/system/config.js' + import constant from '@/utils/constant' + import { + setStrData + } from '@/utils/auth.js' export default { components: { tabBarVue, @@ -52,6 +59,7 @@ }, onLoad: function() { this.nowUserType = getUserType() + this.selectSiteConfig("platform_tel") }, methods: { updateParams(newVal) { @@ -88,6 +96,29 @@ this.queryParams.pageNo = 1 this.total = 0 }, + /** + * 查询平台配置 + */ + selectSiteConfig(code) { + getSiteConfig({ + code: code + }).then(res => { + let jsonArray = JSON.parse(res.data) + jsonArray.map((item) => { + if (constant.customer_service == item.name) { + setStrData(constant.customer_service, item.value) + } else if (constant.wechat_img == item.name) { + setStrData(constant.wechat_img, item.value) + } + }) + }).catch((e) => { + uni.showToast({ + icon: 'error', + duration: 2000, + title: e + }); + }) + } } } diff --git a/pages/mine/mine-index.vue b/pages/mine/mine-index.vue index ad335bf..9e32d54 100644 --- a/pages/mine/mine-index.vue +++ b/pages/mine/mine-index.vue @@ -134,17 +134,17 @@ 新人手册 - + 联系客服 - + 公众号 - + 加入社区 @@ -160,7 +160,7 @@ - + @@ -176,8 +176,10 @@ formatNumberWithUnits, calculateTimeDifference } from '@/utils/common.js' + import config from '@/config' import { - getJSONData + getJSONData, + getStrData } from '@/utils/auth.js' import { bloggerDetail @@ -203,7 +205,14 @@ globalConfig: getApp().globalData.config, //是否已开通会员 ifHasCard: false, - userInfo: {} + userInfo: {}, + imageUrl: config.baseUrl, + //公众号二维码 + wechat_img: constant.wechat_img, + //客服二维码 + customer_service: constant.customer_service, + //弹窗照片 + popupImgUrl: "", } }, mounted() {}, @@ -225,8 +234,9 @@ } }, methods: { - toggle(type) { + toggle(type, key) { this.type = type + this.popupImgUrl = getStrData(key) // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 this.$refs.popup.open(type) }, diff --git a/static/mine/erweima.jpg b/static/mine/erweima.jpg deleted file mode 100644 index 995c05b..0000000 Binary files a/static/mine/erweima.jpg and /dev/null differ diff --git a/utils/constant.js b/utils/constant.js index b7beb1a..8f213cf 100644 --- a/utils/constant.js +++ b/utils/constant.js @@ -12,6 +12,10 @@ const constant = { //博主 bz: '02', //通告主 - tgz: '01' + tgz: '01', + //微信公众号二维码 + wechat_img: 'wechat_img', + //客服二维码 + customer_service: 'customer_service', } export default constant \ No newline at end of file