<!-- 列表 -->
<view class="wrap-list">
<u-cell-group :border="false">
- <u-cell-item :title="v.name" :title-style="titleStyle" :value="i===0?value:''" @click="toPath(v.path)" v-for="(v,i) in list"
+ <u-cell-item :title="v.name" :title-style="titleStyle" :value="v.value" @click="toPath(v.path)" v-for="(v,i) in list"
:key="i">
<u-icon :name="v.icon" custom-prefix="custom-icon" size="40" slot="icon" color="#2FA8E1"></u-icon>
</u-cell-item>
</template>
<script>
+ const app = getApp()
export default {
data() {
return {
'fontSize': '28rpx',
'marginLeft': '30rpx'
},
- value: "0积分",
list: [{
name: "我的积分",
path: "/pages/sub_mine/integral/index",
- icon: "integral"
+ icon: "integral",
+ value:'0积分'
},
{
name: "我的足迹",
path: "/pages/sub_mine/cashFlow/index",
- icon: "bills"
+ icon: "bills",
+ value:''
},
{
name: "我的卡券",
path: "/pages/sub_mine/voucher/index",
- icon: "voucher"
+ icon: "voucher",
+ value:''
},
{
name: "账户安全",
path: "/pages/sub_mine/accountSafe/index",
- icon: "safe"
+ icon: "safe",
+ value:''
},
{
name: "我的消息",
path: "/pages/sub_mine/message/index",
- icon: "message"
+ icon: "message",
+ value:''
},
{
name: "留言反馈",
path: "/pages/sub_mine/leaveMsg/index",
- icon: "leaveMsg"
+ icon: "leaveMsg",
+ value:''
},
],
loginOut: {
marginTop: '100rpx',
color:'#ffffff',
backgroundColor:'#2FA8E1'
- }
+ },
+ version:''
}
},
computed: {
that.tel = '暂无号码'
that.name = '游客'
}
+ that.list[that.list.length-1].value = 'v' + app.globalData.version
},
methods: {
exit() {
getIntegral(){
let that = this
that.$u.get("/v1/point/total",{}).then(res=>{
- that.value = res.data + '积分'
+ that.list[0].value = res.data + '积分'
})
}
},
.status_bar {
background-color: #4EB4E4;
}
-
.loginOut {
width: 600rpx;
padding: 50rpx 0;
margin-top: 100rpx;
}
-
.wrap {
font-family: "PingFang-SC-Medium";
&-mine {
--- /dev/null
+let config = {}
+
+if (process.env.NODE_ENV === 'development') {
+ // 开发环境
+ config = {
+ // #ifdef H5
+ base_api: "/api", //测试地址
+ // #endif
+ // base_api: "http://172.28.43.20:8089/portal/mobileapi",//本地地址
+ // #ifndef H5
+ base_api: 'http://yy.dlsmk.cn:8080/portal/mobileapi',
+ // #endif
+ }
+
+} else {
+ // 生产环境
+ config = {
+ base_api: 'https://yy.dlsmk.cn/portal/mobileapi'
+ }
+}
+
+export default config
+import config from './config.js'
+const base_url = config.base_api
+console.log(base_url)
const install = (Vue, vm) => {
// 此为自定义配置参数,具体参数见上方说明
Vue.prototype.$u.http.setConfig({
- // baseUrl: 'https://yy.dlsmk.cn/payapi/mobileapi', // 大理智警域名
- // baseUrl:'https://yy.dlsmk.cn/portal/mobileapi', //正式地址
- // baseUrl:'http://yy.dlsmk.cn:8080/portal/mobileapi', //测试地址
- // baseUrl:'/api',
- baseUrl: "http://172.28.43.20:8089/portal/mobileapi",//本地地址
- // method: 'POST',
+ baseUrl: base_url,
// 设置为json,返回后会对数据进行一次JSON.parse()
dataType: 'json',
// sslVerify:false,
const tenantid = uni.getStorageSync('tenantid');
if (token) {
config.header['Authorization'] = "Bearer " + token;
- }else{
+ } else {
config.header['Authorization'] = ''
}
//console.log(config.url,config.header['Authorization'])
config.header["X-TENANT-ID"] = tenantid;
- if (config.url == "/i/activity" || config.url == "/v1/feedback/release"
- || config.url == '/medicineapi/medicalcard/add' || config.url == '/medicalapi/pay'
- ||config.url == '/v1/security/save' || config.url == '/i/security/check' || config.url == '/i/security/pwdset') {
+ if (config.url == "/i/activity" || config.url == "/v1/feedback/release" ||
+ config.url == '/medicineapi/medicalcard/add' || config.url == '/medicalapi/pay' ||
+ config.url == '/v1/security/save' || config.url == '/i/security/check' || config.url == '/i/security/pwdset') {
config.header['content-type'] = "application/json";
} else {
config.header['content-type'] = "application/x-www-form-urlencoded";
// 如果配置了originalData为true,请留意这里的返回值
if (res.data.code == 200) {
return res.data
- } else if(res.data.code == 500){
+ } else if (res.data.code == 500) {
uni.showModal({
title: "提示",
content: res.data.code + ":" + res.data.msg,
uni.showToast({
title: "登录状态失效,请重新登录",
icon: "none",
- mask:true,
+ mask: true,
duration: 1500,
complete(res) {
setTimeout(() => {
} else {
// 如果返回false,则会调用Promise的reject回调,
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
- if(res.errMsg.indexOf('fail') == -1){
+ if (res.errMsg.indexOf('fail') == -1) {
uni.showModal({
title: "错误",
content: res.data.status + ":" + res.data.message,
// content: `${res.data.status}:${res.data.message}`,
showCancel: false,
})
- }else{
+ } else {
uni.showModal({
title: "错误",
content: res.errMsg,
// export default install
module.exports = install
-