|
|
@@ -2,296 +2,310 @@
|
|
|
<view class="page">
|
|
|
<view class="list_info">
|
|
|
<view class="">
|
|
|
- <!-- 基础设置组 -->
|
|
|
- <view class="group-header">基础设置</view>
|
|
|
- <view class="item basic" v-for="(item,index) in basicSettings" :key="item.name + index" @click="goPage(item.path)">
|
|
|
- <view class="item-left">
|
|
|
- <image class="icon" :src="item.icon" mode="widthFix"></image>
|
|
|
- <text>{{item.name}}</text>
|
|
|
+ <!-- 基础设置组 -->
|
|
|
+ <view class="group-header">基础设置</view>
|
|
|
+ <view class="item basic" v-for="(item, index) in basicSettings" :key="item.name + index"
|
|
|
+ @click="goPage(item.path)">
|
|
|
+ <view class="item-left">
|
|
|
+ <image class="icon" :src="item.icon" mode="widthFix"></image>
|
|
|
+ <text>{{ item.name }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ <switch v-if="item.switch == 1" checked class="custom-switch" color="#acf934"
|
|
|
+ style="transform:scale(0.7)" />
|
|
|
+ <image v-else class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="item-right">
|
|
|
- <switch v-if="item.switch == 1" checked class="custom-switch" color="#acf934" style="transform:scale(0.7)" />
|
|
|
- <image v-else class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="">
|
|
|
<!-- 更多设置组 -->
|
|
|
- <view class="group-header" style="margin-top: 20rpx;">更多</view>
|
|
|
- <view class="item more" v-for="(item,index) in moreSettings" :key=" index + item.name" @click="goPage(item.path)">
|
|
|
- <view class="item-left">
|
|
|
- <image class="icon" :src="item.icon" mode="widthFix"></image>
|
|
|
- <text>{{item.name}}</text>
|
|
|
- </view>
|
|
|
- <view class="item-right">
|
|
|
- <switch v-if="item.switch == 1" color="#acf934" @change="switch1Change" checked class="custom-switch" style="transform:scale(0.7)" />
|
|
|
- <image v-else class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
|
|
|
+ <view class="group-header" style="margin-top: 20rpx;">更多</view>
|
|
|
+ <view class="item more" v-for="(item, index) in moreSettings" :key="index + item.name"
|
|
|
+ @click=" goPage(item.path, item)">
|
|
|
+ <view class="item-left">
|
|
|
+ <image class="icon" :src="item.icon" mode="widthFix"></image>
|
|
|
+ <text>{{ item.name }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-right">
|
|
|
+ <switch v-if="item.switch == 1" color="#acf934" @change="switch1Change" checked
|
|
|
+ class="custom-switch" style="transform:scale(0.7)" />
|
|
|
+ <image v-else class="arrow" src="../../static/me/arrow_right_gray.png" mode="widthFix"></image>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
<!-- 版本信息 -->
|
|
|
<view class="version-info">
|
|
|
- <text>版本号 {{version}}</text>
|
|
|
+ <text>版本号 {{ version }}</text>
|
|
|
</view>
|
|
|
|
|
|
<!-- 退出登录按钮 -->
|
|
|
<view class="btn_submit" @click="logout">退出登录</view>
|
|
|
|
|
|
<DialogBox ref="DialogBox"></DialogBox>
|
|
|
+ <CustomerServicePopup ref="customerServicePopup"></CustomerServicePopup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- components: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- title: '',
|
|
|
- sel: 1,
|
|
|
- myinfo: {},
|
|
|
- version: '',
|
|
|
- basicSettings: [{
|
|
|
- 'name': '账户与安全',
|
|
|
- 'desc': '',
|
|
|
- 'path': '/pages/my/security',
|
|
|
- 'icon': '../../static/me/wd_icon_zhanghuyuanquan.png'
|
|
|
- },
|
|
|
- {
|
|
|
- 'name': '基本资料',
|
|
|
- 'desc': '',
|
|
|
- 'path': '/pages/my/editInfo',
|
|
|
- 'icon': '../../static/me/wd_icon_jibenziliao.png'
|
|
|
- },
|
|
|
- {
|
|
|
- 'name': '青少年模式',
|
|
|
- 'switch': 0,
|
|
|
- 'desc': '',
|
|
|
- 'path': '/pages/my/idcheck',
|
|
|
- 'icon': '../../static/me/wd_icon_qingshaonianmoshi.png'
|
|
|
- }
|
|
|
- ],
|
|
|
- moreSettings: [{
|
|
|
- 'name': '通知设置',
|
|
|
- 'desc': '',
|
|
|
- 'path': '/pages/my/pushSet',
|
|
|
- 'icon': '../../static/me/wd_icon_tonzhishezhi.png'
|
|
|
- },
|
|
|
- {
|
|
|
- 'name': '服务条款',
|
|
|
- 'desc': '',
|
|
|
- 'path': '/pages/AboutUs/xieyi',
|
|
|
- 'icon': '../../static/me/wd_icon_fuwutiaokuan.png'
|
|
|
- },
|
|
|
- {
|
|
|
- 'name': '接收内容推荐',
|
|
|
- 'switch': 1,
|
|
|
- 'desc': '',
|
|
|
- 'path': '',
|
|
|
- 'icon': '../../static/me/wd_icon_jieshouneirongtuijian.png'
|
|
|
- },
|
|
|
- {
|
|
|
- 'name': '联系客服',
|
|
|
- 'desc': '',
|
|
|
- 'path': 'kefu',
|
|
|
- 'icon': '../../static/me/wd_icon_lianxikefu.png'
|
|
|
- }
|
|
|
- ]
|
|
|
+import CustomerServicePopup from '@/components/CustomerServicePopup/CustomerServicePopup.vue'
|
|
|
+export default {
|
|
|
+ components: { CustomerServicePopup },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ sel: 1,
|
|
|
+ myinfo: {},
|
|
|
+ version: '',
|
|
|
+ basicSettings: [{
|
|
|
+ 'name': '账户与安全',
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '/pages/my/security',
|
|
|
+ 'icon': '../../static/me/wd_icon_zhanghuyuanquan.png',
|
|
|
+ 'propup': ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'name': '基本资料',
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '/pages/my/editInfo',
|
|
|
+ 'icon': '../../static/me/wd_icon_jibenziliao.png',
|
|
|
+ 'propup': ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'name': '青少年模式',
|
|
|
+ 'switch': 0,
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '/pages/my/idcheck',
|
|
|
+ 'icon': '../../static/me/wd_icon_qingshaonianmoshi.png',
|
|
|
+ 'propup': ''
|
|
|
}
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- this.getAppVersion()
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- this.loadData();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getAppVersion() {
|
|
|
- uni.getSystemInfo({
|
|
|
- success: (info) => {
|
|
|
- // app系统环境
|
|
|
- let appPlatform = info.platform;
|
|
|
- console.log("appPlatform", info)
|
|
|
- // #ifdef H5
|
|
|
- this.version = 'V' + info.appVersion;
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
|
- this.version = 'V' + wgtinfo.version;
|
|
|
- });
|
|
|
- // #endif
|
|
|
- }
|
|
|
- });
|
|
|
+ ],
|
|
|
+ moreSettings: [{
|
|
|
+ 'name': '通知设置',
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '/pages/my/pushSet',
|
|
|
+ 'icon': '../../static/me/wd_icon_tonzhishezhi.png',
|
|
|
+ 'propup': ''
|
|
|
},
|
|
|
- switch1Change(e){
|
|
|
- alert(e.detail.value,"改变了")
|
|
|
+ {
|
|
|
+ 'name': '服务条款',
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '/pages/AboutUs/xieyi',
|
|
|
+ 'icon': '../../static/me/wd_icon_fuwutiaokuan.png',
|
|
|
+ 'propup': ''
|
|
|
},
|
|
|
- onBack() {},
|
|
|
- chkSel() {
|
|
|
- if (this.sel == 1) {
|
|
|
- this.sel = 0;
|
|
|
- } else {
|
|
|
- this.sel = 1;
|
|
|
- }
|
|
|
+ {
|
|
|
+ 'name': '接收内容推荐',
|
|
|
+ 'switch': 1,
|
|
|
+ 'desc': '',
|
|
|
+ 'path': '',
|
|
|
+ 'icon': '../../static/me/wd_icon_jieshouneirongtuijian.png',
|
|
|
+ 'propup': ''
|
|
|
},
|
|
|
- goPage(page) {
|
|
|
- if (page == 'delete') {
|
|
|
- this.DelMem();
|
|
|
- } else if (page == 'yszc') {
|
|
|
-
|
|
|
- // #ifdef APP-PLUS
|
|
|
- plus.runtime.openURL('https://e.zhichao.art/web/yszc.php') // plus.runtime.openWeb(href);
|
|
|
- // #endif
|
|
|
-
|
|
|
+ {
|
|
|
+ 'name': '联系客服',
|
|
|
+ 'desc': '',
|
|
|
+ 'path': 'kefu',
|
|
|
+ 'icon': '../../static/me/wd_icon_lianxikefu.png',
|
|
|
+ 'propup': 'customPopup'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.getAppVersion()
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ openCustomPopup() {
|
|
|
+ this.$refs.customerServicePopup.$refs.customPopup.open()
|
|
|
+ },
|
|
|
+ getAppVersion() {
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success: (info) => {
|
|
|
+ // app系统环境
|
|
|
+ let appPlatform = info.platform;
|
|
|
+ console.log("appPlatform", info)
|
|
|
// #ifdef H5
|
|
|
- window.open('https://e.zhichao.art/web/yszc.php')
|
|
|
+ this.version = 'V' + info.appVersion;
|
|
|
// #endif
|
|
|
- } else if (page == 'kefu') {
|
|
|
- let that = this;
|
|
|
// #ifdef APP-PLUS
|
|
|
- plus.share.getServices(res => {
|
|
|
- const wechat = res.find(i => i.id === 'weixin')
|
|
|
- if (wechat) {
|
|
|
- wechat.openCustomerServiceChat({
|
|
|
- corpid: 'wwbc06aa8311b6ac08',
|
|
|
- // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
|
|
|
- url: that.myinfo.wxkf
|
|
|
- }, src => {
|
|
|
- console.log("success:")
|
|
|
- }, err => {
|
|
|
- console.log("error:")
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: '没有检测到微信,请先安装',
|
|
|
- icon: "error"
|
|
|
- });
|
|
|
- }
|
|
|
+ plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
|
|
|
+ this.version = 'V' + wgtinfo.version;
|
|
|
});
|
|
|
// #endif
|
|
|
-
|
|
|
- } else if (page != '') {
|
|
|
- uni.navigateTo({
|
|
|
- url: page,
|
|
|
- })
|
|
|
}
|
|
|
- },
|
|
|
- DelMem() {
|
|
|
- var that = this;
|
|
|
- this.$refs['DialogBox'].confirm({
|
|
|
- title: '警告',
|
|
|
- content: '1、注销账号是不可逆操作,该账号下所有一切资料一旦注销无法恢复;\n2、注销后,你账号下所有权益将被清除。',
|
|
|
- DialogType: 'inquiry',
|
|
|
- btn1: '否',
|
|
|
- btn2: '是',
|
|
|
- animation: 0
|
|
|
- }).then(() => {
|
|
|
- uni.request({
|
|
|
- url: that.$apiHost + '/My/delete', //检测是否已绑定
|
|
|
- data: {
|
|
|
- uuid: getApp().globalData.uuid
|
|
|
- },
|
|
|
- header: {
|
|
|
- 'content-type': 'application/json' //自定义请求头信息
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- uni.removeStorageSync("wapptoken");
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ switch1Change(e) {
|
|
|
+ alert(e.detail.value, "改变了")
|
|
|
+ },
|
|
|
+ onBack() { },
|
|
|
+ chkSel() {
|
|
|
+ if (this.sel == 1) {
|
|
|
+ this.sel = 0;
|
|
|
+ } else {
|
|
|
+ this.sel = 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goPage(page) {
|
|
|
+ if (page == 'delete') {
|
|
|
+ this.DelMem();
|
|
|
+ } else if (page == 'yszc') {
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ plus.runtime.openURL('https://e.zhichao.art/web/yszc.php') // plus.runtime.openWeb(href);
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef H5
|
|
|
+ window.open('https://e.zhichao.art/web/yszc.php')
|
|
|
+ // #endif
|
|
|
+ } else if (page == 'kefu') {
|
|
|
+ // let that = this;
|
|
|
+ // // #ifdef APP-PLUS
|
|
|
+ // plus.share.getServices(res => {
|
|
|
+ // const wechat = res.find(i => i.id === 'weixin')
|
|
|
+ // if (wechat) {
|
|
|
+ // wechat.openCustomerServiceChat({
|
|
|
+ // corpid: 'wwbc06aa8311b6ac08',
|
|
|
+ // // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
|
|
|
+ // url: that.myinfo.wxkf
|
|
|
+ // }, src => {
|
|
|
+ // console.log("success:")
|
|
|
+ // }, err => {
|
|
|
+ // console.log("error:")
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '没有检测到微信,请先安装',
|
|
|
+ // icon: "error"
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
+ this.openCustomPopup()
|
|
|
+ } else if (page != '') {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: page,
|
|
|
})
|
|
|
- },
|
|
|
- loadData() {
|
|
|
- console.log({
|
|
|
- uuid: getApp().globalData.uuid,
|
|
|
- skey: getApp().globalData.skey
|
|
|
- });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ DelMem() {
|
|
|
+ var that = this;
|
|
|
+ this.$refs['DialogBox'].confirm({
|
|
|
+ title: '警告',
|
|
|
+ content: '1、注销账号是不可逆操作,该账号下所有一切资料一旦注销无法恢复;\n2、注销后,你账号下所有权益将被清除。',
|
|
|
+ DialogType: 'inquiry',
|
|
|
+ btn1: '否',
|
|
|
+ btn2: '是',
|
|
|
+ animation: 0
|
|
|
+ }).then(() => {
|
|
|
uni.request({
|
|
|
- url: this.$apiHost + '/Web/getinfo',
|
|
|
+ url: that.$apiHost + '/My/delete', //检测是否已绑定
|
|
|
data: {
|
|
|
uuid: getApp().globalData.uuid
|
|
|
},
|
|
|
header: {
|
|
|
- "content-type": "application/json",
|
|
|
- 'sign': getApp().globalData.headerSign
|
|
|
+ 'content-type': 'application/json' //自定义请求头信息
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log("----:", res.data);
|
|
|
- this.myinfo = res.data;
|
|
|
- },
|
|
|
- complete: (com) => {
|
|
|
- // uni.hideLoading();
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- console.log("----e:", e);
|
|
|
+ uni.removeStorageSync("wapptoken");
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/login',
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
- },
|
|
|
- EditNickname() {
|
|
|
- let that = this;
|
|
|
- this.$refs['DialogBox'].confirm({
|
|
|
- title: '更改昵称',
|
|
|
- placeholder: '请输入修改的昵称',
|
|
|
- value: that.myinfo.nickname,
|
|
|
- DialogType: 'input',
|
|
|
- animation: 0
|
|
|
- }).then((res) => {
|
|
|
- if (res.value.length < 1) {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadData() {
|
|
|
+ console.log({
|
|
|
+ uuid: getApp().globalData.uuid,
|
|
|
+ skey: getApp().globalData.skey
|
|
|
+ });
|
|
|
+ uni.request({
|
|
|
+ url: this.$apiHost + '/Web/getinfo',
|
|
|
+ data: {
|
|
|
+ uuid: getApp().globalData.uuid
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ "content-type": "application/json",
|
|
|
+ 'sign': getApp().globalData.headerSign
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log("----:", res.data);
|
|
|
+ this.myinfo = res.data;
|
|
|
+ },
|
|
|
+ complete: (com) => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ },
|
|
|
+ fail: (e) => {
|
|
|
+ console.log("----e:", e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ EditNickname() {
|
|
|
+ let that = this;
|
|
|
+ this.$refs['DialogBox'].confirm({
|
|
|
+ title: '更改昵称',
|
|
|
+ placeholder: '请输入修改的昵称',
|
|
|
+ value: that.myinfo.nickname,
|
|
|
+ DialogType: 'input',
|
|
|
+ animation: 0
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.value.length < 1) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入有效的昵称",
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ that.myinfo.nickname = res.value;
|
|
|
+ let obj2 = {
|
|
|
+ nickname: res.value
|
|
|
+ }
|
|
|
+ const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
|
|
|
+ uni.request({
|
|
|
+ url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
|
|
|
+ data: postData,
|
|
|
+ method: 'POST',
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json', //自定义请求头信息
|
|
|
+ 'Access-Control-Allow-Origin': '*'
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
uni.showToast({
|
|
|
- title: "请输入有效的昵称",
|
|
|
+ title: res.data.str,
|
|
|
icon: 'none'
|
|
|
});
|
|
|
- return;
|
|
|
}
|
|
|
- that.myinfo.nickname = res.value;
|
|
|
- let obj2 = {
|
|
|
- nickname: res.value
|
|
|
- }
|
|
|
- const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
|
|
|
- uni.request({
|
|
|
- url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
|
|
|
- data: postData,
|
|
|
- method: 'POST',
|
|
|
- header: {
|
|
|
- 'content-type': 'application/json', //自定义请求头信息
|
|
|
- 'Access-Control-Allow-Origin': '*'
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.str,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- },
|
|
|
- logout() {
|
|
|
- this.$refs['DialogBox'].confirm({
|
|
|
- title: '提示',
|
|
|
- content: '确定要退出登录吗?',
|
|
|
- DialogType: 'inquiry',
|
|
|
- btn1: '取消',
|
|
|
- btn2: '确定',
|
|
|
- animation: 0
|
|
|
- }).then(() => {
|
|
|
- uni.removeStorageSync("wapptoken");
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/login/login',
|
|
|
- })
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ logout() {
|
|
|
+ this.$refs['DialogBox'].confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定要退出登录吗?',
|
|
|
+ DialogType: 'inquiry',
|
|
|
+ btn1: '取消',
|
|
|
+ btn2: '确定',
|
|
|
+ animation: 0
|
|
|
+ }).then(() => {
|
|
|
+ uni.removeStorageSync("wapptoken");
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/login',
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- @import 'setting.scss';
|
|
|
-
|
|
|
-
|
|
|
+@import 'setting.scss';
|
|
|
</style>
|