App.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <script>
  2. /**
  3. * vuex管理登陆状态,具体可以参考官方登陆模板示例
  4. */
  5. import {
  6. mapMutations
  7. } from 'vuex';
  8. export default {
  9. globalData: {
  10. // 外网测试地址
  11. //apiUrl: 'https://dd.meetingfuture.top',// api请求地址
  12. //tuiguangmaUrl: 'https://dd.meetingfuture.top/storeCode/',
  13. // 生产地址
  14. apiUrl: 'http://127.0.0.1:8081',// 移动端api请求地址(client-app)
  15. platApiUrl: 'http://127.0.0.1:8080',// 管理平台api请求地址(client-plat)
  16. tuiguangmaUrl: 'http://127.0.0.1:8081/storeCode/',
  17. // 本地地址
  18. // apiUrl: 'http://127.0.0.1:8081',// 移动端api请求地址(client-app)
  19. storeInfo: null,
  20. version: 'v1',
  21. },
  22. methods: {
  23. ...mapMutations(['login']),
  24. getStoreInfo() {
  25. //更新登陆状态
  26. return uni.getStorageSync('storeInfo') || ''
  27. },
  28. },
  29. async onLaunch(options) {
  30. let storeInfo = this.getStoreInfo();
  31. if (storeInfo.storeId) {
  32. this.login(storeInfo);
  33. this.globalData.storeInfo = storeInfo
  34. } else {
  35. uni.redirectTo({
  36. url: '/pages/login/login'
  37. })
  38. }
  39. },
  40. onLoad() {
  41. },
  42. onShow: function() {
  43. },
  44. onHide: function() {
  45. },
  46. }
  47. </script>
  48. <style lang='scss'>
  49. @import "@/uni_modules/uview-ui/index.scss";
  50. /*
  51. 全局公共样式和字体图标
  52. */
  53. @font-face {
  54. font-family: iconfont;
  55. font-weight: normal;
  56. font-style: normal;
  57. src: url('@/static/iconfont.ttf') format('truetype');
  58. }
  59. .iconfont {
  60. font-family: "iconfont" !important;
  61. font-size: 16px;
  62. font-style: normal;
  63. -webkit-font-smoothing: antialiased;
  64. -moz-osx-font-smoothing: grayscale;
  65. }
  66. .icon-fenlei:before {
  67. content: "\e653";
  68. }
  69. .icon-23gaojingguize:before {
  70. content: "\e6a6";
  71. }
  72. .icon-gengxin:before {
  73. content: "\e7cb";
  74. }
  75. .icon-kefu:before {
  76. content: "\e625";
  77. }
  78. .icon-yinxingqia3:before {
  79. content: "\e657";
  80. }
  81. .icon-weibiaoti--:before {
  82. content: "\e60f";
  83. }
  84. .icon-suoxiao:before {
  85. content: "\e7de";
  86. }
  87. .icon-xuanzhuan:before {
  88. content: "\e630";
  89. }
  90. .icon-add:before {
  91. content: "\e600";
  92. }
  93. .icon-fangda2:before {
  94. content: "\e63f";
  95. }
  96. .icon-c_icon3:before {
  97. content: "\e603";
  98. }
  99. .icon-fensi:before {
  100. content: "\e74e";
  101. }
  102. .icon-guanzhu:before {
  103. content: "\e610";
  104. }
  105. .icon-shezhi:before {
  106. content: "\e601";
  107. }
  108. .icon-daifahuo:before {
  109. content: "\e61a";
  110. }
  111. .icon-daipingjia1:before {
  112. content: "\e635";
  113. }
  114. .icon-tuikuan:before {
  115. content: "\e608";
  116. }
  117. .icon-daishouhuo:before {
  118. content: "\e661";
  119. }
  120. .icon-daifukuan2:before {
  121. content: "\e82f";
  122. }
  123. .icon-jia:before {
  124. content: "\e60b";
  125. }
  126. .icon-jian:before {
  127. content: "\e647";
  128. }
  129. .icon-liangdu:before {
  130. content: "\e71b";
  131. }
  132. .icon-liangdu1:before {
  133. content: "\e618";
  134. }
  135. .icon-shouhuodizhi:before {
  136. content: "\e64e";
  137. }
  138. .icon-weixinzhifu:before {
  139. content: "\e606";
  140. }
  141. .icon-you:before {
  142. content: "\e642";
  143. }
  144. .icon-xuanze:before {
  145. content: "\e640";
  146. }
  147. .icon-xuanze1:before {
  148. content: "\e621";
  149. }
  150. .icon-2xuanzhong:before {
  151. content: "\e605";
  152. }
  153. .icon-pinpai:before {
  154. content: "\e602";
  155. }
  156. .icon-shouji:before {
  157. content: "\e6a1";
  158. }
  159. .icon-dizhi:before {
  160. content: "\e769";
  161. }
  162. .icon-huati:before {
  163. content: "\e8c4";
  164. }
  165. .icon-yue:before {
  166. content: "\e69d";
  167. }
  168. .icon-tuijianren:before {
  169. content: "\e641";
  170. }
  171. view,
  172. scroll-view,
  173. swiper,
  174. swiper-item,
  175. cover-view,
  176. cover-image,
  177. icon,
  178. text,
  179. rich-text,
  180. progress,
  181. button,
  182. checkbox,
  183. form,
  184. input,
  185. label,
  186. radio,
  187. slider,
  188. switch,
  189. textarea,
  190. navigator,
  191. audio,
  192. camera,
  193. image,
  194. video {
  195. box-sizing: border-box;
  196. }
  197. /* 骨架屏替代方案 */
  198. .Skeleton {
  199. background: #f3f3f3;
  200. padding: 20upx 0;
  201. border-radius: 8upx;
  202. }
  203. /* 图片载入替代方案 */
  204. .image-wrapper {
  205. font-size: 0;
  206. background: #f3f3f3;
  207. border-radius: 4px;
  208. }
  209. .clamp {
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. white-space: nowrap;
  213. display: block;
  214. }
  215. .common-hover {
  216. background: #f5f5f5;
  217. }
  218. /*边框*/
  219. .b-b:after,
  220. .b-t:after {
  221. position: absolute;
  222. z-index: 3;
  223. left: 0;
  224. right: 0;
  225. height: 0;
  226. content: '';
  227. transform: scaleY(.5);
  228. border-bottom: 1px solid $border-color-base;
  229. }
  230. .b-b:after {
  231. bottom: 0;
  232. }
  233. .b-t:after {
  234. top: 0;
  235. }
  236. /* button样式改写 */
  237. uni-button,
  238. button {
  239. font-size: $font-lg + 2upx;
  240. font-weight: normal;
  241. background: #fff;
  242. &.no-border:before,
  243. &.no-border:after {
  244. border: none;
  245. }
  246. }
  247. button::after {
  248. border: none;
  249. }
  250. uni-button[type=default],
  251. button[type=default] {
  252. color: $font-color-dark;
  253. }
  254. /* 立即购买样式 */
  255. .buyButton {
  256. position: absolute;
  257. right: 20upx;
  258. bottom: 20upx;
  259. height: 40upx;
  260. line-height: 40upx;
  261. font-size: 28upx;
  262. background: $uni-color-button;
  263. color: #fff;
  264. padding: 4upx 10upx;
  265. height: auto;
  266. border: none;
  267. }
  268. /* 返利样式 */
  269. .rebate {
  270. color: $uni-color-word;
  271. font-size: 30rpx;
  272. white-space: nowrap;
  273. padding: 0 4rpx;
  274. margin: 0 20upx;
  275. border-radius: 10rpx;
  276. }
  277. /* 已售样式 */
  278. .sold {
  279. color: gray;
  280. font-size: 20rpx;
  281. white-space: nowrap;
  282. padding: 0 4rpx;
  283. border-radius: 10rpx;
  284. }
  285. /* 优惠样式 */
  286. .discount {
  287. padding: 4upx 10upx;
  288. border: 1px solid #d23540;
  289. color: #d23540;
  290. border-radius: 10upx;
  291. font-size: 24upx;
  292. display: inline;
  293. float: left;
  294. display: inline-block !important;
  295. }
  296. /* input 样式 */
  297. .input-placeholder {
  298. color: #999999;
  299. }
  300. .placeholder {
  301. color: #999999;
  302. }
  303. /* 居中 */
  304. .center {
  305. display: flex;
  306. justify-content: center;
  307. align-items: center;
  308. }
  309. /* 垂直居中 */
  310. .column {
  311. display: flex;
  312. flex-direction: column;
  313. align-items: center;
  314. }
  315. .between {
  316. display: flex;
  317. justify-content: space-between;
  318. align-items: center;
  319. }
  320. .onelines {
  321. overflow: hidden;
  322. white-space: nowrap;
  323. text-overflow: ellipsis;
  324. }
  325. /* 最多显示两行超出显示点点点 */
  326. .twolines {
  327. text-overflow: -o-ellipsis-lastline;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. display: -webkit-box;
  331. -webkit-line-clamp: 2;
  332. -webkit-box-orient: vertical;
  333. }
  334. .activityLogo {
  335. position: absolute;
  336. top: 0;
  337. right: 0;
  338. width: 100upx;
  339. height: auto;
  340. }
  341. .sellLogo {
  342. position: absolute;
  343. top: 0;
  344. left: 0;
  345. width: 100upx;
  346. height: auto;
  347. }
  348. /* ios底部安全距离-padding */
  349. .savepadding {
  350. padding-bottom: constant(safe-area-inset-bottom);
  351. padding-bottom: env(safe-area-inset-bottom);
  352. box-sizing: content-box;
  353. }
  354. /* ios底部安全距离-bottom */
  355. .savebottom {
  356. bottom: constant(safe-area-inset-bottom);
  357. bottom: env(safe-area-inset-bottom);
  358. }
  359. .column-cen {
  360. display: flex;
  361. justify-content: center;
  362. flex-direction: column;
  363. align-items: center;
  364. }
  365. .zanwu {
  366. padding-top: 300upx;
  367. color: #cdcdcd;
  368. image{
  369. margin-bottom: 40upx;
  370. }
  371. }
  372. </style>