specs_1.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view class="specs">
  3. <!-- 规格 -->
  4. <uni-popup ref="specShow" background-color="#fff" type="bottom" :is-mask-click="false">
  5. <view class="popup">
  6. <view class="close">
  7. <text @click="toClose" class="iconfont icon-shanchu"></text>
  8. </view>
  9. <!-- <view class="info_1" v-if="popupShow=='1'">
  10. <view class="info_1">
  11. <scroll-view scroll-y="true" class="scroll-view">
  12. <view class="list-scroll-view">
  13. <view class="one">
  14. <view class="one_1">
  15. <view class="l">
  16. <image class="image"
  17. :src="specsInfo.file&&specsInfo.file.length>0?specsInfo.file[0].url:info.goods.file[0].url"
  18. mode="aspectFill" @tap="diaView"></image>
  19. </view>
  20. <view class="r">
  21. <view class="money">
  22. <text v-if="specsInfo.leader_price"
  23. class="money_2"><text>团长价¥</text>{{specsInfo.leader_price}}</text>
  24. <text v-if="specsInfo.price"
  25. class="money_1"><text>特价¥</text>{{specsInfo.price}}</text>
  26. <text v-if="!specsInfo.price&&!specsInfo.leader_price"
  27. class="money_1"><text>¥</text>{{specsInfo.sell_money}}</text>
  28. <text class="money_1"><text>¥</text>{{specsInfo.flow_money}}</text>
  29. </view>
  30. <view class="other_1">
  31. <text>已选:</text>
  32. <text>{{specsInfo.name}}</text>
  33. </view>
  34. <view class="other_1">
  35. <text>运费:</text>
  36. <text>{{specsInfo.freight===0?'包邮':specsInfo.freight+'元'}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="one_2">
  41. <view class="one_2_1">
  42. 规格
  43. </view>
  44. <view class="one_2_2">
  45. <view
  46. :class="['list',is_specs!=index&&item.num>0?'list':is_specs!=index&&item.num<=0?'huilist':is_specs==index&&item.num>0?'redlist':is_specs==index&&item.num<=0?'huiilist':'list']"
  47. v-for="(item,index) in info.specs" :key="index" @tap="toSpecs(item)">
  48. <text>{{item.name}}</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="one_3">
  53. <view class="one_3_1">
  54. <text>数量</text>
  55. </view>
  56. <view class="one_3_1">
  57. <uni-number-box v-model="buy_num" @change="toCount" :min="1"
  58. :max="specsInfo.num">
  59. </uni-number-box>
  60. </view>
  61. <view class="one_3_1">
  62. <text>库存{{specsInfo.num||0}}</text><text class="limit"
  63. v-if="specsInfo.limit_num">({{specsInfo.buy_name||'暂无'}}{{specsInfo.limit_num||0}}个)</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </scroll-view>
  69. </view> -->
  70. <!-- <view class="info_2">
  71. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="btn_type=='0'">
  72. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toMarket">加入购物车</button>
  73. </view>
  74. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="btn_type=='1'">
  75. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toBuy">立即购买</button>
  76. </view>
  77. <view :class="[specsInfo.can_group=='0'?'btns':'btn']" v-if="specsInfo.can_group=='0'">
  78. <button :disabled="is_zero" :class="[is_zero?'btncolor':'']" @tap="toGroup">我要开团</button>
  79. </view>
  80. </view> -->
  81. </view>
  82. <!-- <view class="info_3" v-else-if="popupShow=='2'">
  83. <scroll-view scroll-y="true" class="scroll-view">
  84. <view class="list" v-for="(item,index) in info.act" :key="index">
  85. <view class="list_1" @tap="toAct(item)">
  86. <view class="title_1">
  87. <view class="l">
  88. <text>{{item.tag||'暂无'}}</text>{{item.act_time.title}}
  89. </view>
  90. <view class="r">
  91. <text class="iconfont icon-jiantouyou"></text>
  92. </view>
  93. </view>
  94. <view class="title_2">
  95. <view class="text" v-if="item.type=='5'||item.type=='6'">{{item.text}}</view>
  96. <view class="time">{{item.config.time_start}}-{{item.config.time_end}}</view>
  97. </view>
  98. <view class="title_2" v-if="item.type=='2'">
  99. <view class="specList" v-for="(tag,indexx) in item.list" :key="indexx">
  100. <view class="name">规格:{{tag.spec_name}}</view>
  101. <view class="giftList" v-for="(tags,indexs) in tag.gift" :key="indexs"
  102. @tap.stop="tags.type=='0' && getDetail(tags)">
  103. <view class="left">
  104. <view class="goods">{{tags.goods_name}}{{tags.spec_name}}</view>
  105. <view class="goods">{{tags.desc}}</view>
  106. <view class="num">×{{tags.num}}</view>
  107. </view>
  108. <view class="right"><text class="iconfont icon-jiantouyou"></text>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </scroll-view>
  116. </view> -->
  117. <!-- <view class="info_4" v-else>
  118. <view class="info_4">
  119. <scroll-view scroll-y="true" class="scroll-view">
  120. <view class="list-scroll-view">
  121. <view class="list" v-for="(item,index) in info.sets" :key="index">
  122. <view class="name"><text class="set">套装</text>{{item.name}}</view>
  123. <view class="set">
  124. <view class="set_1" v-for="(tag,indexx) in item.set" :key="indexx"
  125. @tap="toDeatil(tag)">
  126. <image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''"
  127. mode="aspectFit">
  128. </image>
  129. <view class="goods textOver">{{tag.goods_name}}</view>
  130. <view class="spec textOver">{{tag.spec_name}}</view>
  131. </view>
  132. </view>
  133. <view class="bottom">
  134. <view class="money">
  135. 共{{item.goods_total||0}}件,套装价:<text>¥{{item.sell_money||0}}</text>
  136. </view>
  137. <view class="add">
  138. <button size="mini" @tap="toSetMarket(item)">加入购物车</button>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </scroll-view>
  144. </view>
  145. </view> -->
  146. </view>
  147. </uni-popup>
  148. <!-- <view class="dialog" v-if="dialog.show==true" @tap="dialogClose">
  149. <view class="dialog_1" v-if="dialog.type=='1'">
  150. <swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
  151. <swiper-item class="list" v-for="(item,index) in info.specs" :key="index">
  152. <view class="list_1">
  153. <image class="image"
  154. :src="item.file&&item.file.length>0?item.file[0].url:info.goods.file[0].url"
  155. mode="aspectFit"></image>
  156. </view>
  157. <view class="name">
  158. <text>{{item.name}}</text>
  159. </view>
  160. </swiper-item>
  161. </swiper>
  162. </view>
  163. </view> -->
  164. </view>
  165. </template>
  166. <script>
  167. export default {
  168. props: {
  169. goodsInfo: {
  170. type: Object,
  171. },
  172. goodsColect: {
  173. type: Boolean
  174. }
  175. },
  176. data() {
  177. return {
  178. // 图片
  179. fileList: [],
  180. // 活动
  181. acttagsList: [],
  182. };
  183. },
  184. methods: {
  185. toGoodscolect() {
  186. const that = this;
  187. that.$emit('toGoodscolect')
  188. }
  189. },
  190. watch: {
  191. goodsInfo: {
  192. deep: true,
  193. immediate: true,
  194. handler(val) {
  195. if (val && val.file.length > 0) this.$set(this, `fileList`, val.file)
  196. if (val && val.act_tags.length > 0) this.$set(this, `acttagsList`, val.act_tags)
  197. }
  198. }
  199. },
  200. }
  201. </script>
  202. <style lang="scss">
  203. .banner {
  204. .banner_1 {
  205. border-bottom: 0.5vw solid var(--f9Color);
  206. swiper {
  207. height: 44vh !important;
  208. }
  209. .list {
  210. border-radius: 5px;
  211. .image {
  212. width: 100%;
  213. height: 100%;
  214. border-radius: 5px;
  215. background-color: #fff;
  216. }
  217. }
  218. .goodsColect {
  219. position: fixed;
  220. top: 2vw;
  221. right: 3vw;
  222. z-index: 99;
  223. background-color: #858585;
  224. border-radius: 90px;
  225. text {
  226. font-size: 30px;
  227. }
  228. }
  229. .acttags {
  230. position: absolute;
  231. top: 1vw;
  232. left: 1vw;
  233. width: 97%;
  234. text {
  235. display: inline-block;
  236. background-color: #ff0000;
  237. color: #fff;
  238. border-radius: 1vw;
  239. padding: 0.5vw;
  240. font-size: 12px;
  241. margin: 0 1vw 0 0;
  242. }
  243. }
  244. }
  245. }
  246. </style>