setting.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const sheep_index = require("../../sheep/index.js");
  4. require("../../sheep/store/index.js");
  5. require("../../sheep/helper/index.js");
  6. const sheep_api_member_auth = require("../../sheep/api/member/auth.js");
  7. require("../../sheep/request/index.js");
  8. require("../../sheep/config/index.js");
  9. require("../../sheep/api/index.js");
  10. require("../../sheep/api/distri/score.js");
  11. require("../../sheep/api/distri/share.js");
  12. require("../../sheep/api/distri/team.js");
  13. require("../../sheep/api/infra/file.js");
  14. require("../../sheep/api/member/address.js");
  15. require("../../sheep/api/member/point.js");
  16. require("../../sheep/api/member/signin.js");
  17. require("../../sheep/api/member/social.js");
  18. require("../../sheep/api/member/user.js");
  19. require("../../sheep/api/migration/app.js");
  20. require("../../sheep/api/migration/chat.js");
  21. require("../../sheep/api/migration/index.js");
  22. require("../../sheep/api/migration/third.js");
  23. require("../../sheep/api/pay/channel.js");
  24. require("../../sheep/api/pay/order.js");
  25. require("../../sheep/api/pay/wallet.js");
  26. require("../../sheep/api/product/category.js");
  27. require("../../sheep/api/product/comment.js");
  28. require("../../sheep/api/product/favorite.js");
  29. require("../../sheep/api/product/history.js");
  30. require("../../sheep/api/product/spu.js");
  31. require("../../sheep/api/promotion/activity.js");
  32. require("../../sheep/api/promotion/article.js");
  33. require("../../sheep/api/promotion/bargain.js");
  34. require("../../sheep/api/promotion/combination.js");
  35. require("../../sheep/api/promotion/coupon.js");
  36. require("../../sheep/api/promotion/diy.js");
  37. require("../../sheep/api/promotion/rewardActivity.js");
  38. require("../../sheep/api/promotion/seckill.js");
  39. require("../../sheep/api/system/area.js");
  40. require("../../sheep/api/system/voice.js");
  41. require("../../sheep/api/trade/afterSale.js");
  42. require("../../sheep/api/trade/brokerage.js");
  43. require("../../sheep/api/trade/cart.js");
  44. require("../../sheep/api/trade/config.js");
  45. require("../../sheep/api/trade/delivery.js");
  46. require("../../sheep/api/trade/order.js");
  47. require("../../sheep/url/index.js");
  48. require("../../sheep/router/index.js");
  49. require("../../sheep/hooks/useModal.js");
  50. require("../../sheep/helper/test.js");
  51. require("../../sheep/helper/throttle.js");
  52. require("../../sheep/platform/index.js");
  53. require("../../sheep/platform/provider/wechat/index.js");
  54. require("../../sheep/platform/provider/wechat/miniProgram.js");
  55. require("../../sheep/platform/provider/apple/index.js");
  56. require("../../sheep/platform/share.js");
  57. require("../../sheep/platform/pay.js");
  58. require("../../sheep/config/zIndex.js");
  59. require("../../sheep/store/app.js");
  60. require("../../sheep/store/user.js");
  61. require("../../sheep/store/cart.js");
  62. require("../../sheep/store/sys.js");
  63. require("../../sheep/store/modal.js");
  64. require("../../sheep/helper/digit.js");
  65. if (!Array) {
  66. const _easycom_uni_list_chat2 = common_vendor.resolveComponent("uni-list-chat");
  67. const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
  68. const _easycom_su_image2 = common_vendor.resolveComponent("su-image");
  69. const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
  70. const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
  71. const _easycom_su_fixed2 = common_vendor.resolveComponent("su-fixed");
  72. const _easycom_s_layout2 = common_vendor.resolveComponent("s-layout");
  73. (_easycom_uni_list_chat2 + _easycom_uni_list_item2 + _easycom_su_image2 + _easycom_uni_list2 + _easycom_uni_forms2 + _easycom_su_fixed2 + _easycom_s_layout2)();
  74. }
  75. const _easycom_uni_list_chat = () => "../../uni_modules/uni-list/components/uni-list-chat/uni-list-chat.js";
  76. const _easycom_uni_list_item = () => "../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
  77. const _easycom_su_image = () => "../../sheep/ui/su-image/su-image.js";
  78. const _easycom_uni_list = () => "../../uni_modules/uni-list/components/uni-list/uni-list.js";
  79. const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js";
  80. const _easycom_su_fixed = () => "../../sheep/ui/su-fixed/su-fixed.js";
  81. const _easycom_s_layout = () => "../../sheep/components/s-layout/s-layout.js";
  82. if (!Math) {
  83. (_easycom_uni_list_chat + _easycom_uni_list_item + _easycom_su_image + _easycom_uni_list + _easycom_uni_forms + _easycom_su_fixed + _easycom_s_layout)();
  84. }
  85. const _sfc_main = {
  86. __name: "setting",
  87. setup(__props) {
  88. const isLogin = common_vendor.computed(() => sheep_index.sheep.$store("user").isLogin);
  89. const state = common_vendor.reactive({
  90. model: {},
  91. // 个人信息
  92. rules: {},
  93. thirdInfo: {}
  94. // 社交用户的信息
  95. });
  96. const userInfo = common_vendor.computed(() => sheep_index.sheep.$store("user").userInfo);
  97. const getUserInfo = async () => {
  98. const userInfo2 = await sheep_index.sheep.$store("user").getInfo();
  99. state.model = common_vendor.lodashExports.clone(userInfo2);
  100. if (sheep_index.sheep.$platform.name !== "H5") {
  101. const result = await sheep_index.sheep.$platform.useProvider("wechat").getInfo();
  102. state.thirdInfo = result || {};
  103. }
  104. };
  105. function onLogout() {
  106. common_vendor.index.showModal({
  107. title: "提示",
  108. content: "确认退出账号?",
  109. success: async function(res) {
  110. if (!res.confirm) {
  111. return;
  112. }
  113. const {
  114. code
  115. } = await sheep_api_member_auth.AuthUtil.logout();
  116. if (code !== 0) {
  117. return;
  118. }
  119. sheep_index.sheep.$store("user").logout();
  120. common_vendor.index.removeStorageSync("linkId");
  121. sheep_index.sheep.$router.go("/pages/index/user");
  122. }
  123. });
  124. }
  125. common_vendor.onBeforeMount(() => {
  126. getUserInfo();
  127. });
  128. return (_ctx, _cache) => {
  129. var _a, _b, _c;
  130. return common_vendor.e({
  131. a: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/user/info")),
  132. b: common_vendor.p({
  133. clickable: true,
  134. ["avatar-circle"]: true,
  135. title: (_a = state.model) == null ? void 0 : _a.nickname,
  136. avatar: (_b = state.model) == null ? void 0 : _b.avatar,
  137. note: "个性签名"
  138. }),
  139. c: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/user/address/list")),
  140. d: common_vendor.p({
  141. clickable: true,
  142. title: "实体收货地址管理",
  143. showArrow: true,
  144. border: false
  145. }),
  146. e: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/user/dummyAddress/list")),
  147. f: common_vendor.p({
  148. clickable: true,
  149. title: "虚拟收货地址管理",
  150. showArrow: true,
  151. border: false
  152. }),
  153. g: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/user/address/list")),
  154. h: common_vendor.p({
  155. clickable: !userInfo.value.mobile,
  156. title: "实名认证",
  157. showArrow: true,
  158. border: false
  159. }),
  160. i: common_vendor.p({
  161. current: 0,
  162. src: (_c = state.model) == null ? void 0 : _c.avatar,
  163. height: 100,
  164. width: 100,
  165. radius: 0,
  166. mode: "scaleToFill"
  167. }),
  168. j: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/pages/user/qrcode-share")),
  169. k: common_vendor.p({
  170. title: "我的二维码",
  171. clickable: true,
  172. border: false
  173. }),
  174. l: common_vendor.p({
  175. border: false
  176. }),
  177. m: common_vendor.p({
  178. model: state.model,
  179. rules: state.rules,
  180. labelPosition: "left",
  181. border: true
  182. }),
  183. n: isLogin.value
  184. }, isLogin.value ? {
  185. o: common_vendor.o(onLogout)
  186. } : {}, {
  187. p: common_vendor.p({
  188. bottom: true,
  189. placeholder: true
  190. }),
  191. q: common_vendor.p({
  192. title: "用户信息"
  193. })
  194. });
  195. };
  196. }
  197. };
  198. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-806b15dc"], ["__file", "D:/zx/mall-front-app/pages/user/setting.vue"]]);
  199. wx.createPage(MiniProgramPage);