my.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. const Parse = getApp().Parse;
  2. const company = getApp().globalData.company;
  3. var Nova = getApp().Nova;
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. options: null,
  10. bgColor: {
  11. type: String,
  12. value: "#009de1",
  13. },
  14. active: {
  15. type: Number,
  16. value: 0,
  17. },
  18. bg: {
  19. type: String,
  20. value: "",
  21. },
  22. },
  23. /**
  24. * 组件的初始数据
  25. */
  26. data: {
  27. cells: [{
  28. name: "邀请开店",
  29. image: "",
  30. url: "/nova-shop/pages/nova-shopadmin/pages/index",
  31. }, ],
  32. orders: [{
  33. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/48v41b053445.png",
  34. title: "待付款",
  35. url: "/nova-shop/pages/myOrder/index?status=100",
  36. },
  37. {
  38. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/b1ct81053443.png",
  39. title: "待发货",
  40. url: "/nova-shop/pages/myOrder/index?status=200",
  41. },
  42. {
  43. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/i5dhua053443.png",
  44. title: "待收货",
  45. url: "/nova-shop/pages/myOrder/index?status=300",
  46. },
  47. {
  48. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/391obv053444.png",
  49. title: "待评价",
  50. url: "/nova-shop/pages/myOrder/index?status=700",
  51. },
  52. {
  53. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/m7oco1053444.png",
  54. title: "售后",
  55. url: "/nova-shop/pages/myOrder/afterSale/index",
  56. },
  57. ],
  58. orders_4: [{
  59. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/4v1m71045125.png",
  60. title: "已付款",
  61. url: "/nova-shop/pages/myOrder/index?status=100",
  62. },
  63. {
  64. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/539a1i045125.png",
  65. title: "待发货",
  66. url: "/nova-shop/pages/myOrder/index?status=200",
  67. },
  68. {
  69. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/kso4ii045126.png",
  70. title: "待收货",
  71. url: "/nova-shop/pages/myOrder/index?status=300",
  72. },
  73. {
  74. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/31l4d1045125.png",
  75. title: "评价",
  76. url: "/nova-shop/pages/myOrder/index?status=700",
  77. },
  78. {
  79. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/bau13p045126.png",
  80. title: "退货/售后",
  81. url: "/nova-shop/pages/myOrder/afterSale/index",
  82. },
  83. ],
  84. orders_5: [{
  85. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/9tir12041446.png",
  86. title: "已付款",
  87. url: "/nova-shop/pages/myOrder/index?status=100",
  88. },
  89. {
  90. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/f1ufod041446.png",
  91. title: "待发货",
  92. url: "/nova-shop/pages/myOrder/index?status=200",
  93. },
  94. {
  95. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/d724j1041447.png",
  96. title: "待收货",
  97. url: "/nova-shop/pages/myOrder/index?status=300",
  98. },
  99. {
  100. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/f1ca9l041446.png",
  101. title: "评价",
  102. url: "/nova-shop/pages/myOrder/index?status=700",
  103. },
  104. {
  105. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/ikpa11041447.png",
  106. title: "退货/售后",
  107. url: "/nova-shop/pages/myOrder/afterSale/index",
  108. },
  109. ],
  110. brandShop: [{
  111. id: 1111,
  112. image: "https://file-cloud.fmode.cn/lb486SzXLP/20211207/gq1rq8091433.png",
  113. txt: "待付款",
  114. url: "/nova-shop/pages/myOrder/index?status=100",
  115. },
  116. {
  117. id: 2222,
  118. image: "https://file-cloud.fmode.cn/lb486SzXLP/20211207/44pj91091432.png",
  119. txt: "待发货",
  120. url: "/nova-shop/pages/myOrder/index?status=200",
  121. },
  122. {
  123. id: 3333,
  124. image: "https://file-cloud.fmode.cn/lb486SzXLP/20211207/2gm0os091432.png",
  125. txt: "待收货",
  126. url: "/nova-shop/pages/myOrder/index?status=300",
  127. },
  128. {
  129. id: 4444,
  130. image: "https://file-cloud.fmode.cn/lb486SzXLP/20211207/f12m5m091433.png",
  131. txt: "待评价",
  132. url: "/nova-shop/pages/myOrder/index?status=700",
  133. },
  134. {
  135. id: 5555,
  136. image: "https://file-cloud.fmode.cn/lb486SzXLP/20211207/uh105n091433.png",
  137. txt: "退换/售后",
  138. url: "/nova-shop/pages/myOrder/afterSale/index",
  139. },
  140. ],
  141. brShop: [{
  142. id: 1111,
  143. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/hqi7h1044726.png",
  144. txt: "待付款",
  145. url: "/nova-shop/pages/myOrder/index?status=100",
  146. },
  147. {
  148. id: 2222,
  149. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/e3se1t044727.png",
  150. txt: "待发货",
  151. url: "/nova-shop/pages/myOrder/index?status=200",
  152. },
  153. {
  154. id: 3333,
  155. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/smnh1b044727.png",
  156. txt: "待收货",
  157. url: "/nova-shop/pages/myOrder/index?status=300",
  158. },
  159. {
  160. id: 4444,
  161. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/m1ui91044727.png",
  162. txt: "待评价",
  163. url: "/nova-shop/pages/myOrder/index?status=700",
  164. },
  165. {
  166. id: 5555,
  167. image: "https://file-cloud.fmode.cn/nCCirOU5zn/20211215/4j5u1q044726.png",
  168. txt: "退换/售后",
  169. url: "/nova-shop/pages/myOrder/afterSale/index",
  170. },
  171. ],
  172. },
  173. ready: function() {
  174. this.getUser();
  175. this.getAccount();
  176. },
  177. /**
  178. * 组件的方法列表
  179. */
  180. methods: {
  181. async getUser() {
  182. let _user = new Parse.Query("_User");
  183. if (Parse.User.current() && Parse.User.current().id) {
  184. let user = await _user.get(Parse.User.current().id);
  185. console.log(user);
  186. this.setData({
  187. user: user.toJSON(),
  188. });
  189. }
  190. },
  191. async getAccount() {
  192. if (Parse.User.current() && Parse.User.current().id) {
  193. let uid = Parse.User.current().id;
  194. let account = new Parse.Query("Account");
  195. account.equalTo("user", uid);
  196. let res = await account.first();
  197. if (res && res.id) {
  198. console.log(res.toJSON());
  199. let account = res.toJSON()
  200. account.balance = account.balance ? Number(account.balance.toFixed(2)) : 0
  201. account.credit = account.credit ? Number(account.credit.toFixed(2)) : 0
  202. this.setData({
  203. account: account,
  204. });
  205. }
  206. }
  207. },
  208. _toEdit() {
  209. console.log("edit");
  210. },
  211. goNovaURL: function(ev) {
  212. console.log(ev)
  213. let url = ev.currentTarget.dataset.url;
  214. Nova.goNovaURL(url);
  215. },
  216. toVIP() {
  217. wx.navigateTo({
  218. url: '/nova-shop/pages/vip/index',
  219. });
  220. },
  221. cellClick() {
  222. // wx.showToast({
  223. // title: "功能开发中,尽请期待",
  224. // icon: "none",
  225. // });
  226. wx.navigateTo({
  227. url: '/nova-shop/pages/coupons/index',
  228. });
  229. },
  230. sign() {
  231. wx.navigateTo({
  232. url: '/nova-common/pages/daily-check/index',
  233. });
  234. },
  235. coupons() {
  236. wx.navigateTo({
  237. url: '',
  238. });
  239. },
  240. },
  241. });