program.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view>
  3. <view class="swiper_cent" style="position: relative;">
  4. <view style="position: absolute; z-index: 999;">
  5. <uni-nav-bar left-icon="back" backgroundColor="transparent" :border="false" color="#555555" @clickLeft="back" :statusBar="true"></uni-nav-bar>
  6. </view>
  7. <swiper style="height: 900rpx;" :indicator-dots="false" :autoplay="true" :interval="5000" :duration="1000" @change="swiperChange" :circular="true">
  8. <swiper-item v-for="(item,index) in goodsdetais.banner_imgs" :key="index" @click="goPage(item.url)">
  9. <image :src="item.banner_imgs" style="width: 100%;height: 900rpx;" mode="aspectFill"></image>
  10. </swiper-item>
  11. </swiper>
  12. <view class="swiper_zhishi">
  13. <view :class="swiperKey===i?'view_active':''" v-for="(item1,i) in goodsdetais.banner_imgs" :key="i"></view>
  14. </view>
  15. </view>
  16. <view class="suit">
  17. <view class="suititle">
  18. <text class="suitname">套装内商品</text>
  19. <view class="suitimg">
  20. <image src="../../static/image/programioc.png" mode="aspectFill"></image>
  21. </view>
  22. <text class="suiteng">IN SET GOODS</text>
  23. </view>
  24. <view class="suitsall">
  25. <view class="suitgoods" v-for="(i,index) in goodsdetais.compositionGoods" :key="index" @click="goGoods(i.goods.id)">
  26. <image :src="i.goods.cover_pic" mode="aspectFill"></image>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="magcard">
  31. <view class="cardtitle">
  32. <view class="titleone">
  33. <text class="suitname">{{goodsdetais.name}}</text>
  34. <text class="nametag">{{goodsdetais.tag}}</text>
  35. <view style="overflow: visible;">
  36. <text class="coutall">已售{{goodsdetais.sale_num}}</text>
  37. </view>
  38. </view>
  39. <view class="titlewo">
  40. <text class="qing">{{exampleHouse_name}} </text>
  41. <text class="qing" style="padding-left: 10rpx;padding-right: 0;">{{goodsdetais.estate_name?goodsdetais.estate_name:''}}</text>
  42. <text class="daprice">{{goodsdetais.actual_price}}元</text>
  43. </view>
  44. <view class="pricecop"><text>券后价</text></view>
  45. <view class="price">
  46. <text style="font-size: 18rpx;padding-right: 8rpx;font-weight: 600;">¥ </text>
  47. <text style="font-size: 46rpx;font-weight: 800;">{{goodsdetais.discount_amount}}</text>
  48. <text style="font-size: 18rpx;padding-left: 12rpx;">元</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="total">
  53. <view class="opentotal">
  54. <view class="you">
  55. <text class="">套装内商品</text>
  56. <view class="zhan" >
  57. <text class="">数量</text>
  58. <view class="openbutton" v-show="!opensuit">
  59. </view>
  60. </view>
  61. </view>
  62. <view class="gan" :style="{'margin-right':!opensuit?'90rpx':'0'}"></view>
  63. </view>
  64. <view class="opentotal" v-for="(item,index) in goodsdetais.compositionGoods" :key="index" v-show="!opensuit?index<2:gotoal.length-1">
  65. <view class="you">
  66. <text class="" style="width: 450rpx;">{{item.goods.name}}</text>
  67. <view class="zhan">
  68. <text class="">x1</text>
  69. <view class="openbutton" v-if="index==1&&!opensuit&&vesuit" @click="opemSuit()">
  70. <text>展开</text>
  71. <uni-icons type="bottom" size="15" color="#A18353;"></uni-icons>
  72. </view>
  73. <view class="openbutton" v-else v-show="!opensuit"></view>
  74. </view>
  75. </view>
  76. <view class="gan" :style="{'margin-right':!opensuit?'90rpx':'0'}"></view>
  77. </view>
  78. </view>
  79. <!-- <view class="webview">
  80. <view v-html="goodsdetais.details" class="detailsd"></view>
  81. </view> -->
  82. <view style="margin-top: 20rpx;">
  83. <bd-detail :detail="goodsdetais.details" ></bd-detail>
  84. </view>
  85. <view class="addshop" @click="open">
  86. <uni-icons type="cart-filled" size="40" color="#fff"></uni-icons>
  87. </view>
  88. <uni-popup ref="popup" type="center">
  89. <view class="icode">
  90. <text style="font-size: 28rpx;">扫描二维码,去微信商城购买</text>
  91. <view class="codeimg">
  92. <image src="/static/image/hxj.jpg" mode="aspectFill"></image>
  93. </view>
  94. </view>
  95. </uni-popup>
  96. <!-- <view class="canshu">
  97. <view class="canshutitle">
  98. <text style="font-size: 24rpx;font-weight: 500;">Product parameters</text>
  99. <text style="font-size: 46rpx;font-weight: 800;">产品参数</text>
  100. </view>
  101. <view class="td-form">
  102. <uni-table border :stripe="false" emptyText="暂无更多数据" >
  103. <uni-tr v-for="(item,index) in 5" :key="index">
  104. <uni-td width="90" align="center" color="#303030" bold="bold">产品名称</uni-td>
  105. <uni-td color="#666666" bold="500">休闲沙发</uni-td>
  106. </uni-tr>
  107. </uni-table>
  108. </view>
  109. </view>
  110. </view> -->
  111. </view>
  112. </template>
  113. <script>
  114. let _this
  115. import bdDetail from "@/components/goods/bd-detail.vue"
  116. export default {
  117. components: {
  118. bdDetail,
  119. },
  120. data() {
  121. return {
  122. id:'',
  123. content:[
  124. ],
  125. goodsdetais:[],
  126. exampleHouse_name:'',
  127. opensuit:false,
  128. vesuit:false,
  129. webview:'/static/image/zu.png',
  130. swiperKey: 0, //轮播位置
  131. gotoal:[
  132. {
  133. "name":"ins风高档皮质沙发",
  134. "total":"x1"
  135. },
  136. {
  137. "name":"ins风高档吊灯",
  138. "total":"x1"
  139. },
  140. {
  141. "name":"ins风高档吊灯",
  142. "total":"x1"
  143. },
  144. ],
  145. }
  146. },
  147. onLoad(option) {
  148. _this=this
  149. "id" in option?this.id=JSON.parse(option.id):''
  150. if(this.gotoal.length>2){
  151. this.vesuit=true
  152. }
  153. this.getGoods()
  154. },
  155. methods: {
  156. open() {
  157. this.$refs.popup.open()
  158. },
  159. back(){
  160. uni.navigateBack({
  161. delta:1
  162. })
  163. },
  164. opemSuit(){
  165. this.opensuit=true
  166. },
  167. swiperChange(e) {
  168. this.swiperKey = e.detail.current
  169. },
  170. goGoods(id){
  171. uni.navigateTo({
  172. url: "/pages/goods-details/goods-details?id="+id
  173. })
  174. },
  175. goPage(url) {
  176. uni.navigateTo({
  177. url: url
  178. })
  179. },
  180. getGoods(){
  181. uni.showLoading({
  182. title:"加载中"
  183. })
  184. _this.$post('plugin/composition/api/index/info',{
  185. data:{
  186. composition_id:_this.id
  187. },
  188. success(res){
  189. if(res.code==1){
  190. _this.$toast(res.msg)
  191. }else{
  192. _this.goodsdetais=res.data
  193. _this.exampleHouse_name=res.data.exampleHouse.name
  194. uni.hideLoading()
  195. }
  196. },
  197. error(err) {
  198. _this.$toast(err)
  199. }
  200. },'POST')
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang="scss">
  206. .icode{
  207. width: 600rpx;
  208. height: 600rpx;
  209. background-color: #fff;
  210. border-radius: 15rpx;
  211. display: flex;
  212. flex-direction: column;
  213. justify-content: center;
  214. align-items: center;
  215. .codeimg{
  216. margin-top: 10rpx;
  217. width: 450rpx;
  218. height: 450rpx;
  219. image{
  220. width: 100%;
  221. height: 100%;
  222. }
  223. }
  224. }
  225. .addshop{
  226. position: fixed;
  227. bottom: 80rpx;
  228. z-index: 999;
  229. right: 70rpx;
  230. width: 120rpx;
  231. height: 120rpx;
  232. border-radius: 50%;
  233. background-color: #AE8445;
  234. display: flex;
  235. align-items: center;
  236. justify-content: center;
  237. }
  238. .detailsd{
  239. p{
  240. font-size: 20rpx;
  241. }
  242. }
  243. .webview{
  244. margin-top: 10rpx;
  245. width: 100%;
  246. height: 100%;
  247. image{
  248. width: 100%;
  249. height: 100%;
  250. }
  251. }
  252. page{
  253. font-family: PingFang-SC-Heavy;
  254. }
  255. .swiper_cent {
  256. position: relative;
  257. .swiper_zhishi {
  258. display: flex;
  259. align-items: center;
  260. width: 100%;
  261. justify-content: center;
  262. position: absolute;
  263. bottom: 39rpx;
  264. view {
  265. width: 81rpx;
  266. height: 4rpx;
  267. background: #c8c8c8;
  268. }
  269. .view_active {
  270. background: #f4f4f4;
  271. }
  272. }
  273. }
  274. .suit{
  275. padding: 50rpx 0rpx 60rpx 40rpx;
  276. .suititle{
  277. display: flex;
  278. align-items: center;
  279. // .suitname{
  280. // font-size: 35rpx;
  281. // font-weight: 500;
  282. // display: block;
  283. // }
  284. .suitimg{
  285. width: 15rpx;
  286. height: 15rpx;
  287. margin: 0 20rpx;
  288. margin-bottom: 35rpx;
  289. image{
  290. width: 100%;
  291. height: 100%;
  292. }
  293. }
  294. .suiteng{
  295. display: block;
  296. font-size: 25rpx;
  297. color: #999999;
  298. // margin-top: 6rpx;
  299. }
  300. }
  301. }
  302. .suitsall{
  303. display: flex;
  304. flex-wrap: nowrap;
  305. flex-direction: row;
  306. // display: inline-block;
  307. overflow-x: auto;
  308. overflow-y: hidden;
  309. // overflow: hidden;
  310. .suitgoods{
  311. flex-shrink: 0;
  312. margin-top: 30rpx;
  313. margin-right: 25rpx;
  314. width: 168rpx;
  315. height: 168rpx;
  316. border-radius: 25rpx;
  317. display: inline-block;
  318. image{
  319. width: 100%;
  320. height: 100%;
  321. border-radius: 25rpx;
  322. }
  323. }
  324. }
  325. .suitname{
  326. font-size: 30rpx;
  327. font-weight: bold;
  328. display: block;
  329. }
  330. .magcard{
  331. padding: 60rpx 40rpx 30rpx 40rpx;
  332. background-color: #F6F6F6;
  333. border-radius: 60rpx 0 0 0;
  334. .cardtitle{
  335. .titleone{
  336. display: flex;
  337. align-items: center;
  338. height: 40rpx;
  339. overflow: visible;
  340. .nametag{
  341. display: block;
  342. margin-left: 14rpx;
  343. font-size: 20rpx;
  344. padding: 5rpx 10rpx;
  345. background-color: #040404;
  346. color: #FFFFFF;
  347. box-sizing: border-box;
  348. // border-radius: 5rpx;
  349. }
  350. .coutall{
  351. color: #AE8445;
  352. display: block;
  353. overflow: visible;
  354. margin-left: 14rpx;
  355. font-size: 22rpx;
  356. padding: 5rpx 10rpx;
  357. border-radius: 5rpx;
  358. width: 130rpx;
  359. text-align: center;
  360. border: 1rpx solid #AE8445;
  361. }
  362. }
  363. .titlewo{
  364. font-size: 22rpx;
  365. color: #999999;
  366. padding-top: 15rpx;
  367. .qing{
  368. }
  369. .daprice{
  370. text-decoration: line-through;
  371. padding-left: 30rpx;
  372. }
  373. }
  374. .pricecop{
  375. color: #AE8445;
  376. padding-top: 25rpx;
  377. font-size: 22rpx;
  378. }
  379. .price{
  380. display: block;
  381. color: #AE8445;
  382. padding-top: 18rpx;
  383. }
  384. }
  385. }
  386. .total{
  387. padding: 25rpx 50rpx;
  388. .opentotal{
  389. font-size: 25rpx;
  390. .you{
  391. display: flex;
  392. justify-content: space-between;
  393. align-items: center;
  394. padding: 18rpx 0;
  395. .zhan{
  396. display: flex;
  397. }
  398. .openbutton{
  399. width: 120rpx;
  400. text-align: right;
  401. color: #A18353;
  402. }
  403. }
  404. .gan{
  405. margin-left: 62rpx;
  406. // margin-right: 90rpx;
  407. padding: 5rpx 0;
  408. border-bottom: 1rpx solid #EFEFEF;
  409. }
  410. }
  411. }
  412. .canshu{
  413. text-align: center;
  414. .canshutitle{
  415. color: #222222;
  416. display: flex;
  417. flex-direction: column;
  418. margin: 45rpx 0;
  419. }
  420. .td-form{
  421. padding:0 40rpx;
  422. box-sizing: border-box;
  423. padding-bottom: 80rpx;
  424. }
  425. }
  426. </style>