index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="detail">
  3. <!-- header -->
  4. <cu-custom isBack custom bgColor="bg-gradual-blue"><view slot="content">商品详情</view></cu-custom>
  5. <!-- section -->
  6. <view class="section">
  7. <cu-swiper :value="swiperList" />
  8. <view class="bg-white padding">
  9. <view class="flex align-center">
  10. <view style="flex: auto;" class="text-xl text-bold">商品名称</view>
  11. <view @click="favoriteFunc" style="min-width: 100upx;" class="text-center">
  12. <text v-if="dynamic.favorite" class="cuIcon-likefill text-red text-xxl"></text>
  13. <text v-else class="cuIcon-like text-xxl"></text>
  14. </view>
  15. </view>
  16. <view class="flex justify-between align-end margin-top-sm">
  17. <view class="text-price text-red"><cu-price value="100" size="64" /></view>
  18. <view class="text-grey">销量:1000</view>
  19. </view>
  20. <view class="margin-top-sm text-grey">商品详情</view>
  21. </view>
  22. <view class="margin-tb-sm padding bg-white flex">
  23. <view style="min-width: 100upx;" class="text-black text-bold">
  24. 配送至
  25. </view>
  26. <view style="flex: auto;">
  27. <view class="text-grey">
  28. 河南省郑州市中原区是否真<text class="cuIcon-location lg margin-left-sm"></text>
  29. </view>
  30. <view class="">
  31. 张三 18864585256
  32. </view>
  33. </view>
  34. </view>
  35. <view class="padding margin-tb-sm bg-white">
  36. <view class="flex justify-between">
  37. <view class="text-bold text-black text-bold">评价(265)</view>
  38. <view @click="evaluateFunc">查看全部 <text class="cuIcon-right"></text></view>
  39. </view>
  40. <cu-evaluate :value="evaluate"/>
  41. </view>
  42. <view class="bg-white padding-tb">
  43. <view class="text-black text-bold margin-bottom-sm padding-lr">图文介绍</view>
  44. <image v-for="(item,index) in 5" :key="index" lazy-load="true" style="width: 100%;vertical-align: top;display: block;" src="https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg" mode="widthFix"></image>
  45. </view>
  46. </view>
  47. <!-- footer -->
  48. <view class="footer">
  49. <view class=" cu-bar bg-white tabbar border shop">
  50. <view @click="favoriteFunc" v-if="dynamic.favorite" class="action text-orange">
  51. <view class="cuIcon-favorfill"></view>
  52. 已收藏
  53. </view>
  54. <view @click="favoriteFunc" v-else class="action ">
  55. <view class="cuIcon-favor"></view>
  56. 收藏
  57. </view>
  58. <view @click="shoppingCart" class="action">
  59. <view class="cuIcon-cart"><view class="cu-tag badge">99</view></view>
  60. 购物车
  61. </view>
  62. <view class="btn-group">
  63. <button class="cu-btn bg-orange round shadow-blur">加入购物车</button>
  64. <button class="cu-btn bg-red round shadow-blur">立即订购</button>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. dynamic: { favorite: true },
  75. swiperList: [
  76. {
  77. id: 0,
  78. type: 'video',
  79. url: 'https://st0.dancf.com/gaoding/gaoding/229e7928-fb34-4a0c-b12b-b26fc0aba91453332268.mp4'
  80. },
  81. {
  82. id: 1,
  83. type: 'image',
  84. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg'
  85. },
  86. {
  87. id: 2,
  88. type: 'image',
  89. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
  90. },
  91. {
  92. id: 3,
  93. type: 'image',
  94. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
  95. },
  96. {
  97. id: 4,
  98. type: 'image',
  99. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
  100. },
  101. {
  102. id: 5,
  103. type: 'image',
  104. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
  105. },
  106. {
  107. id: 6,
  108. type: 'image',
  109. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
  110. }
  111. ],
  112. evaluate:{
  113. avator:"https://gd-hbimg.huaban.com/1f50f2135ba51e4b9aa20caef41860b15005c9386f0b-LxqWsh_fw658/format/webp",
  114. nickname:"用户昵称",
  115. rate:3,
  116. createTime:"20220622 17:05:30",
  117. detail:"项目 'demo' 编译成功。前端运行日志,请另行在小程序开发工具的控制台查看。",
  118. imgs:[
  119. {
  120. id: 0,
  121. type: 'video',
  122. url: 'https://st0.dancf.com/gaoding/gaoding/229e7928-fb34-4a0c-b12b-b26fc0aba91453332268.mp4'
  123. },
  124. {
  125. id: 1,
  126. type: 'image',
  127. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg'
  128. },
  129. {
  130. id: 2,
  131. type: 'image',
  132. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
  133. },
  134. {
  135. id: 3,
  136. type: 'image',
  137. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
  138. },
  139. {
  140. id: 4,
  141. type: 'image',
  142. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
  143. },
  144. {
  145. id: 5,
  146. type: 'image',
  147. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
  148. },
  149. {
  150. id: 6,
  151. type: 'image',
  152. url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
  153. }
  154. ]
  155. }
  156. };
  157. },
  158. methods: {
  159. favoriteFunc() {
  160. let dynamic = JSON.parse(JSON.stringify(this.dynamic));
  161. dynamic['favorite'] = !dynamic.favorite;
  162. this.dynamic = dynamic;
  163. },
  164. shoppingCart(){
  165. uni.switchTab({
  166. url:"/pages/shoppingCart/index"
  167. })
  168. },
  169. evaluateFunc(){
  170. uni.navigateTo({
  171. url:"/detailPages/evaluate/index"
  172. })
  173. }
  174. },
  175. onShareAppMessage() {
  176. return {};
  177. },
  178. onShareTimeline() {
  179. return {};
  180. }
  181. };
  182. </script>
  183. <style lang="scss" scoped>
  184. .detail{
  185. .footer{
  186. height: calc(100rpx + env(safe-area-inset-bottom) / 2);
  187. padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  188. .cu-bar{
  189. position: fixed;bottom: 0;left: 0;width: 100vw;
  190. }
  191. }
  192. }
  193. </style>