index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <template>
  2. <view class="user_about" :data-theme="theme">
  3. <view>
  4. <view class="text cancelTxt" :class="{cancelTxt: type == 'useraccountcancelnoticeinfo'}">
  5. <mp-html :content="agreementData?agreementData.replace(/<br\/>/ig, ''):''" />
  6. </view>
  7. <view v-if="type === 'useraccountcancelnoticeinfo'" class="btn">
  8. <button @click="cancelBtn" class="sure-btn">申请注销</button>
  9. </view>
  10. </view>
  11. <view class="cancel" v-if="type == 'useraccountcancelnoticeinfo' && loaded">
  12. <view class="acea-row row-center">
  13. <view class="checkbox acea-row row-middle" @click="setCheck">
  14. <text v-if="!check" class="iconfont icon-weixuanzhong"></text>
  15. <text v-else class="iconfont icon-xuanzhong1"></text>
  16. </view>
  17. <view class="ml10">已阅读并同意<text class="font font-color" @click="toCancel">《重要提醒》</text></view>
  18. </view>
  19. </view>
  20. <view class="outMoal" v-if="moal">
  21. <view class="box">
  22. <view class="title">该账号将永久注销</view>
  23. <view class="moalBtn">
  24. <view class="ok" @click="ok">确定</view>
  25. <view class="no" @click="cancelMoal">取消</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. // +----------------------------------------------------------------------
  33. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  34. // +----------------------------------------------------------------------
  35. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  36. // +----------------------------------------------------------------------
  37. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  38. // +----------------------------------------------------------------------
  39. // | Author: CRMEB Team <admin@crmeb.com>
  40. // +----------------------------------------------------------------------
  41. import {
  42. agreementInfo
  43. } from '@/api/api.js'
  44. import {
  45. userOut,
  46. } from '@/api/user.js'
  47. import {
  48. mapGetters
  49. } from "vuex";
  50. import parser from "../components/jyf-parser/jyf-parser";
  51. import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue";
  52. import {
  53. goToAgreement
  54. } from "@/libs/order";
  55. let app = getApp();
  56. export default {
  57. name: 'user_about',
  58. components: {
  59. "jyf-parser": parser,
  60. mpHtml
  61. },
  62. data() {
  63. return {
  64. theme: app.globalData.theme,
  65. type: '',
  66. agreementData: '',
  67. check: false,
  68. moal: false,
  69. loaded: false,
  70. tagStyle: {
  71. img: 'width:100%;display:block;'
  72. },
  73. }
  74. },
  75. onLoad: function(options) {
  76. this.type = options.from;
  77. this.setTitle(this.type);
  78. this.getCacheinfo();
  79. },
  80. methods: {
  81. navigateBack() {
  82. uni.navigateBack();
  83. },
  84. toCancel() {
  85. goToAgreement('useraccountcancelinfo')
  86. },
  87. setCheck() {
  88. this.check = !this.check
  89. },
  90. ok() {
  91. uni.showLoading({
  92. title: '注销中',
  93. mask: true
  94. });
  95. this.moal = false;
  96. userOut().then(res => {
  97. this.$store.commit("clearStorage");
  98. this.$store.dispatch("GetTokenIsExist");
  99. this.$store.dispatch('GetGlobalConfig');
  100. this.$store.dispatch('GetLoginConfig');
  101. this.$store.dispatch('GetThemeConfig');
  102. uni.hideLoading();
  103. setTimeout(() => {
  104. uni.reLaunch({
  105. url: '/pages/index/index'
  106. });
  107. }, 500);
  108. }).then(err => {
  109. uni.hideLoading()
  110. this.$util.Tips({
  111. title: err
  112. });
  113. });
  114. },
  115. cancelBtn() {
  116. if (!this.check) {
  117. return uni.showToast({
  118. title: "请勾选已阅读",
  119. icon: 'none',
  120. duration: 2000,
  121. })
  122. } else {
  123. this.moal = true
  124. }
  125. },
  126. cancelMoal() {
  127. this.moal = false
  128. this.check = false
  129. },
  130. getCacheinfo() {
  131. this.loaded = false;
  132. agreementInfo(this.type).then(res => {
  133. this.agreementData = res.data ? JSON.parse(res.data).agreement : ''
  134. this.loaded = true;
  135. })
  136. },
  137. setTitle(e) {
  138. switch (e) {
  139. case 'aboutusinfo':
  140. uni.setNavigationBarTitle({
  141. title: '关于我们协议'
  142. })
  143. break;
  144. case 'intelligentinfo':
  145. uni.setNavigationBarTitle({
  146. title: '平台资质证明'
  147. })
  148. break;
  149. case 'merincomminginfo':
  150. uni.setNavigationBarTitle({
  151. title: '商户入驻协议'
  152. })
  153. break;
  154. case 'useraccountcancelinfo':
  155. uni.setNavigationBarTitle({
  156. title: '用户注销协议'
  157. })
  158. break;
  159. case 'useraccountcancelnoticeinfo':
  160. uni.setNavigationBarTitle({
  161. title: '用户注销声明'
  162. })
  163. break;
  164. case 'userinfo':
  165. uni.setNavigationBarTitle({
  166. title: '用户注册协议'
  167. })
  168. break;
  169. case 'platfromruleinfo':
  170. uni.setNavigationBarTitle({
  171. title: '平台规则'
  172. })
  173. break;
  174. case 'coupon/agreement/info':
  175. uni.setNavigationBarTitle({
  176. title: '优惠券协议'
  177. })
  178. break;
  179. case 'paid/member/agreement/info':
  180. uni.setNavigationBarTitle({
  181. title: '会员服务协议'
  182. })
  183. break;
  184. default:
  185. uni.setNavigationBarTitle({
  186. title: '用户隐私协议'
  187. })
  188. break;
  189. }
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss">
  195. .user_about {
  196. .text {
  197. font-size: 30rpx;
  198. font-weight: 400;
  199. padding: 30rpx;
  200. color: #282828;
  201. }
  202. .cancelTxt {
  203. overflow: hidden;
  204. overflow-y: auto;
  205. image {
  206. max-width: 100%;
  207. }
  208. }
  209. .cancel {
  210. position: fixed;
  211. bottom: 160rpx;
  212. left: 0;
  213. z-index: 1;
  214. width: 100%;
  215. bottom: 120rpx;
  216. padding: 10rpx 0;
  217. background: #fff;
  218. .checkbox {
  219. text-align: center;
  220. font-size: 24rpx;
  221. font-weight: 400;
  222. span {
  223. margin-left: 5rpx;
  224. }
  225. .font {
  226. @include main_color(theme);
  227. font-style: normal;
  228. }
  229. .iconfont {
  230. font-size: 36rpx;
  231. }
  232. }
  233. .btn {
  234. width: 690rpx;
  235. height: 90rpx;
  236. @include linear-gradient(theme);
  237. border-radius: 45rpx;
  238. margin: 0 auto;
  239. margin-top: 30rpx;
  240. text-align: center;
  241. line-height: 90rpx;
  242. font-size: 32rpx;
  243. font-weight: 400;
  244. color: #FFFFFF;
  245. }
  246. }
  247. }
  248. .outMoal {
  249. width: 100%;
  250. height: 100%;
  251. background: rgba(0, 0, 0, 0.5);
  252. position: fixed;
  253. top: 0;
  254. left: 0;
  255. z-index: 2;
  256. display: flex;
  257. align-items: center;
  258. justify-content: center;
  259. .box {
  260. position: fixed;
  261. width: 590rpx;
  262. height: 258rpx;
  263. background: #FFFFFF;
  264. opacity: 1;
  265. border-radius: 20rpx;
  266. text-align: center;
  267. padding: 50rpx;
  268. .title {
  269. font-size: 30rpx;
  270. font-weight: 600;
  271. color: #282828;
  272. }
  273. .moalBtn {
  274. margin-top: 43rpx;
  275. display: flex;
  276. justify-content: space-between;
  277. .ok {
  278. width: 234rpx;
  279. height: 66rpx;
  280. @include coupons_border_color(theme);
  281. border-radius: 33rpx;
  282. font-size: 26rpx;
  283. line-height: 66rpx;
  284. @include main_color(theme);
  285. }
  286. .no {
  287. width: 234rpx;
  288. height: 66rpx;
  289. @include linear-gradient(theme);
  290. border-radius: 33rpx;
  291. font-size: 26rpx;
  292. color: #FFFFFF;
  293. line-height: 66rpx;
  294. }
  295. }
  296. }
  297. }
  298. .btn {
  299. width: 100%;
  300. height: 120rpx;
  301. background-color: #FFFFFF;
  302. position: fixed;
  303. bottom: 0;
  304. line-height: 120rpx;
  305. padding: 17rpx 0;
  306. .sure-btn {
  307. width: 690rpx;
  308. height: 86rpx;
  309. margin: 0 auto;
  310. line-height: 86rpx;
  311. color: #FFFFFF;
  312. border-radius: 43rpx;
  313. @include main_bg_color(theme);
  314. font-size: 32rpx;
  315. }
  316. }
  317. </style>