share.vue 5.0 KB

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