share.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1">
  6. <text>超值拼团</text>
  7. </view>
  8. <view class="one_2">
  9. <text class="iconfont icon-qianggou"></text>
  10. <text>快叫上伙伴一起抢</text>
  11. <text class="iconfont icon-qianggou"></text>
  12. </view>
  13. </view>
  14. <view class="two">
  15. <view class="two_1">
  16. <view class="img">
  17. <image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode=""></image>
  18. </view>
  19. </view>
  20. <view class="two_2">
  21. <view class="name">
  22. {{info.goods.name}}
  23. </view>
  24. <view class="money">
  25. ¥{{info.goods.sell_money}}元
  26. </view>
  27. <view class="brief">
  28. {{info.goods.brief||''}}
  29. </view>
  30. </view>
  31. </view>
  32. <view class="thr">
  33. <scroll-view scroll-y="true" class="scroll-view">
  34. <view class="list-scroll-view">
  35. <view class="thr_1">
  36. <view class="list" v-for="(item,index) in info.persons" :key="index">
  37. <view class="img">
  38. <image class="image" src="../../static/logo.png" mode=""></image>
  39. </view>
  40. <view class="name">
  41. {{item.name}}
  42. </view>
  43. </view>
  44. <view class="list list_1" v-if="info.group_persons>info.persons.length">
  45. <button type="default" size="mini" @tap.stop="toOpen">参团</button>
  46. </view>
  47. </view>
  48. </view>
  49. </scroll-view>
  50. </view>
  51. </view>
  52. </mobile-frame>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. id: '',
  59. user: {},
  60. info: {
  61. group_persons: 6,
  62. goods: {
  63. file: [ //
  64. {
  65. url: this.$config.logoUrl
  66. }
  67. ],
  68. name: '测试商品',
  69. sell_money: 10,
  70. brief: '信息简介'
  71. },
  72. persons: [ //
  73. {
  74. file: [ //
  75. {
  76. url: this.$config.logoUrl
  77. }
  78. ],
  79. name: '顾红伟'
  80. },
  81. {
  82. file: [ //
  83. {
  84. url: this.$config.logoUrl
  85. }
  86. ],
  87. name: '顾红伟'
  88. },
  89. ]
  90. },
  91. // 分享
  92. share: {
  93. title: '测试商品',
  94. path: `/pagesHome/group/share`,
  95. imageUrl: '',
  96. }
  97. };
  98. },
  99. onLoad: function(e) {
  100. const that = this;
  101. that.$set(that, `id`, e.id || '63437e3ba163596194c3e830');
  102. },
  103. onShow: function() {
  104. const that = this;
  105. that.watchLogin();
  106. that.search();
  107. },
  108. methods: {
  109. watchLogin() {
  110. const that = this;
  111. uni.getStorage({
  112. key: 'token',
  113. success: function(res) {
  114. let user = that.$jwt(res.data);
  115. if (user) that.$set(that, `user`, user)
  116. }
  117. })
  118. },
  119. async search() {
  120. const that = this;
  121. if (that.id) {
  122. let res = await that.$api(`/group/${that.id}`, `GET`);
  123. if (res.errcode == '0') {
  124. // that.$set(that, `info`, res.data);
  125. } else {
  126. uni.showToast({
  127. title: res.errmsg,
  128. icon: 'none'
  129. })
  130. }
  131. }
  132. },
  133. // 参团
  134. toOpen() {
  135. const that = this;
  136. console.log(that.info);
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss">
  142. .main {
  143. display: flex;
  144. flex-direction: column;
  145. width: 100vw;
  146. height: 100vh;
  147. background-color: #23B67A;
  148. .one {
  149. background-color: #D9FDEF;
  150. margin: 2vw 6vw;
  151. border-radius: 10px;
  152. padding: 2vw;
  153. .one_1 {
  154. text-align: center;
  155. border-bottom: 1px dashed #085623;
  156. margin: 0 0 2vw 0;
  157. padding: 0 0 1vw 0;
  158. text {
  159. font-size: 61px;
  160. font-weight: bold;
  161. color: #357846;
  162. font-family: cursive;
  163. }
  164. }
  165. .one_2 {
  166. text-align: center;
  167. text {
  168. padding: 0 5px;
  169. }
  170. text:nth-child(2) {
  171. font-size: 18px;
  172. letter-spacing: 5px;
  173. font-weight: bold;
  174. color: #357846;
  175. }
  176. }
  177. }
  178. .two {
  179. background-color: #D9FDEF;
  180. margin: 2vw;
  181. border-radius: 10px;
  182. padding: 2vw;
  183. display: flex;
  184. .two_1 {
  185. display: flex;
  186. .img {
  187. .image {
  188. width: 100px;
  189. height: 100px;
  190. border-radius: 90px;
  191. }
  192. }
  193. }
  194. .two_2 {
  195. padding: 0 0 0 2vw;
  196. .name {
  197. font-size: 20px;
  198. font-weight: bold;
  199. margin: 0 0 2vw 0;
  200. color: #357846;
  201. }
  202. .money {
  203. font-size: 18px;
  204. color: #ff0000;
  205. font-weight: bold;
  206. margin: 0 0 2vw 0;
  207. }
  208. .brief {
  209. font-size: 14px;
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. -webkit-line-clamp: 2;
  213. word-break: break-all;
  214. display: -webkit-box;
  215. -webkit-box-orient: vertical;
  216. color: #858585;
  217. }
  218. }
  219. }
  220. .thr {
  221. position: relative;
  222. flex-grow: 1;
  223. margin: 0 2vw 2vw 2vw;
  224. width: 94vw;
  225. border-radius: 10px;
  226. border: 3px solid #D9FDEF;
  227. .thr_1 {
  228. padding: 2vw;
  229. display: flex;
  230. flex-wrap: wrap;
  231. .list {
  232. width: 20vw;
  233. text-align: center;
  234. margin: 0 3vw 2vw 0;
  235. .img {
  236. .image {
  237. width: 16vw;
  238. height: 16vw;
  239. border-radius: 90px;
  240. }
  241. }
  242. .name {
  243. font-size: 14px;
  244. font-weight: bold;
  245. }
  246. }
  247. .list:nth-child(4n) {
  248. margin: 0 0 2vw 0;
  249. }
  250. .list_1 {
  251. button {
  252. padding: 0;
  253. border-radius: 90px;
  254. width: 16vw;
  255. height: 16vw;
  256. text-align: center;
  257. line-height: 16vw;
  258. background-color: #ffffff5f;
  259. font-size: 16px;
  260. font-weight: bold;
  261. color: #fff;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. .scroll-view {
  268. position: absolute;
  269. top: 0;
  270. left: 0;
  271. right: 0;
  272. bottom: 0;
  273. .list-scroll-view {
  274. display: flex;
  275. flex-direction: column;
  276. }
  277. }
  278. </style>