setting.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="page">
  3. <view class="list_info">
  4. <view class="item" v-for="(item,index) in list" :key="index" @click="goPage(item.path)">
  5. <text>{{item.name}}</text>
  6. <image v-if="item.desc == '' && item.switch != 1" class="arrow"
  7. src="../../static/me/arrow_right_gray.png" mode="widthFix">
  8. </image>
  9. <text class="desc" v-else>{{item.desc}}</text>
  10. <switch v-if="item.switch == 1" checked color="#FFCC33" style="transform:scale(0.7)" />
  11. </view>
  12. <view class="blankHeight"></view>
  13. </view>
  14. <!-- <view class="btn_submit">退出登录</view> -->
  15. <DialogBox ref="DialogBox"></DialogBox>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. components: {},
  21. data() {
  22. return {
  23. title: '',
  24. sel: 1,
  25. myinfo: {},
  26. list: [{
  27. 'name': '实名认证',
  28. 'desc': '',
  29. 'path': '/pages/my/idcheck'
  30. },
  31. {
  32. 'name': '推送设置',
  33. 'desc': '',
  34. 'path': '/pages/my/pushSet'
  35. },
  36. {
  37. 'name': '修改密码',
  38. 'desc': '',
  39. 'path': '/pages/my/forgetPass'
  40. },
  41. {
  42. 'name': '修改手机号',
  43. 'desc': '',
  44. 'path': '/pages/my/editMobile'
  45. },
  46. // {
  47. // 'name': '打赏设置',
  48. // 'desc': '',
  49. // 'path': '/pages/my/dashang'
  50. // },
  51. {
  52. 'name': '收款账户设置',
  53. 'desc': '',
  54. 'path': '/pages/my/alipaySet'
  55. },
  56. {
  57. 'name': '收货地址设置',
  58. 'desc': '',
  59. 'path': '/pages/my/addressSet'
  60. },
  61. // {
  62. // 'name': '举报记录',
  63. // 'desc': '',
  64. // 'path': ''
  65. // },
  66. {
  67. 'name': '用户协议',
  68. 'desc': '',
  69. 'path': '/pages/AboutUs/yhxy'
  70. },
  71. {
  72. 'name': '隐私政策',
  73. 'desc': '',
  74. 'path': 'yszc'
  75. },
  76. {
  77. 'name': '注销账号',
  78. 'desc': '',
  79. 'path': 'delete'
  80. },
  81. {
  82. 'name': '青少年模式',
  83. 'switch': 0,
  84. 'desc': '',
  85. 'path': '/pages/AboutUs/yong'
  86. },
  87. {
  88. 'name': '企业客服',
  89. 'desc': '',
  90. 'path': 'kefu'
  91. },
  92. ]
  93. }
  94. },
  95. onLoad() {
  96. this.getAppVersion()
  97. },
  98. onShow() {
  99. this.loadData();
  100. },
  101. methods: {
  102. getAppVersion() {
  103. uni.getSystemInfo({
  104. success: (info) => {
  105. // app系统环境
  106. let appPlatform = info.platform;
  107. console.log("appPlatform", info)
  108. // #ifdef H5
  109. this.list.push({
  110. 'name': '版本号',
  111. 'desc': 'V' + info.appVersion,
  112. 'path': ''
  113. })
  114. // #endif
  115. // #ifdef APP-PLUS
  116. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  117. this.list.push({
  118. 'name': '版本号',
  119. 'desc': 'V' + wgtinfo.version,
  120. 'path': ''
  121. })
  122. });
  123. // #endif
  124. }
  125. });
  126. },
  127. onBack() {},
  128. chkSel() {
  129. if (this.sel == 1) {
  130. this.sel = 0;
  131. } else {
  132. this.sel = 1;
  133. }
  134. },
  135. goPage(page) {
  136. if (page == 'delete') {
  137. this.DelMem();
  138. } else if (page == 'yszc') {
  139. // #ifdef APP-PLUS
  140. plus.runtime.openURL('https://e.zhichao.art/web/yszc.php') // plus.runtime.openWeb(href);
  141. // #endif
  142. // #ifdef H5
  143. window.open('https://e.zhichao.art/web/yszc.php')
  144. // #endif
  145. } else if (page == 'kefu') {
  146. let that = this;
  147. // #ifdef APP-PLUS
  148. plus.share.getServices(res => {
  149. const wechat = res.find(i => i.id === 'weixin')
  150. if (wechat) {
  151. wechat.openCustomerServiceChat({
  152. corpid: 'wwbc06aa8311b6ac08',
  153. // url: 'https://work.weixin.qq.com/kfid/kfc4b0bcb4038d00a50'
  154. url: that.myinfo.wxkf
  155. }, src => {
  156. console.log("success:")
  157. }, err => {
  158. console.log("error:")
  159. })
  160. } else {
  161. uni.showToast({
  162. title: '没有检测到微信,请先安装',
  163. icon: "error"
  164. });
  165. }
  166. });
  167. // #endif
  168. } else if (page != '') {
  169. uni.navigateTo({
  170. url: page,
  171. })
  172. }
  173. },
  174. DelMem() {
  175. var that = this;
  176. this.$refs['DialogBox'].confirm({
  177. title: '警告',
  178. content: '1、注销账号是不可逆操作,该账号下所有一切资料一旦注销无法恢复;\n2、注销后,你账号下所有权益将被清除。',
  179. DialogType: 'inquiry',
  180. btn1: '否',
  181. btn2: '是',
  182. animation: 0
  183. }).then(() => {
  184. uni.request({
  185. url: that.$apiHost + '/My/delete', //检测是否已绑定
  186. data: {
  187. uuid: getApp().globalData.uuid
  188. },
  189. header: {
  190. 'content-type': 'application/json' //自定义请求头信息
  191. },
  192. success: (res) => {
  193. uni.removeStorageSync("wapptoken");
  194. uni.redirectTo({
  195. url: '/pages/login/login',
  196. })
  197. }
  198. });
  199. })
  200. },
  201. loadData() {
  202. console.log({
  203. uuid: getApp().globalData.uuid,
  204. skey: getApp().globalData.skey
  205. });
  206. uni.request({
  207. url: this.$apiHost + '/Web/getinfo',
  208. data: {
  209. uuid: getApp().globalData.uuid
  210. },
  211. header: {
  212. "content-type": "application/json",
  213. 'sign': getApp().globalData.headerSign
  214. },
  215. success: (res) => {
  216. console.log("----:", res.data);
  217. this.myinfo = res.data;
  218. },
  219. complete: (com) => {
  220. // uni.hideLoading();
  221. },
  222. fail: (e) => {
  223. console.log("----e:", e);
  224. }
  225. });
  226. },
  227. EditNickname() {
  228. let that = this;
  229. this.$refs['DialogBox'].confirm({
  230. title: '更改昵称',
  231. placeholder: '请输入修改的昵称',
  232. value: that.myinfo.nickname,
  233. DialogType: 'input',
  234. animation: 0
  235. }).then((res) => {
  236. if (res.value.length < 1) {
  237. uni.showToast({
  238. title: "请输入有效的昵称",
  239. icon: 'none'
  240. });
  241. return;
  242. }
  243. that.myinfo.nickname = res.value;
  244. let obj2 = {
  245. nickname: res.value
  246. }
  247. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  248. uni.request({
  249. url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
  250. data: postData,
  251. method: 'POST',
  252. header: {
  253. 'content-type': 'application/json', //自定义请求头信息
  254. 'Access-Control-Allow-Origin': '*'
  255. },
  256. success: (res) => {
  257. uni.showToast({
  258. title: res.data.str,
  259. icon: 'none'
  260. });
  261. }
  262. });
  263. })
  264. },
  265. }
  266. }
  267. </script>
  268. <style scoped lang="scss">
  269. @import 'setting.scss';
  270. </style>