xiang.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="content">
  3. <view style="height: 100%">
  4. <swiper class="swiper" :autoplay="true" interval="2000" duration="500" :circular="true" style="width: 100%; z-index: 1; height: 319rpx">
  5. <swiper-item v-for="(item, index) in 2" :key="index">
  6. <image src="https://mxys.chuanghai-tech.com/wmfile/20240904/05af7c5442bb4a8baa1f5f3071ca2302.jpg" mode="scaleToFill" style="width: 100%"></image>
  7. </swiper-item>
  8. </swiper>
  9. </view>
  10. <view class="title">{{ info.name }}</view>
  11. <view class="beizhu">先囤后用·随时退·过期自动退·可部分退</view>
  12. <!-- 套餐内容 -->
  13. <view class="neirong">
  14. <view class="title title1">套餐内容</view>
  15. <view class="title title2" style="margin-top: 10rpx">
  16. <view class="cicle"></view>
  17. <view style="margin-left: 16rpx">例假周期关怀</view>
  18. </view>
  19. <view class="title title2" style="margin-top: 23rpx">
  20. <view class="cicle"></view>
  21. <view style="margin-left: 16rpx">创海便利店(二食堂1楼) 13267827921</view>
  22. </view>
  23. <view class="xiangnei" v-for="(item, index) in 2" :key="index">
  24. <view>例假期每天一杯红糖姜茶 x1</view>
  25. <view style="color: #000000">¥25</view>
  26. </view>
  27. <!-- 菜品图片 -->
  28. <view class="shop_zheng">
  29. <view class="image-container">
  30. <image
  31. v-for="(item, index) in 5"
  32. :key="index"
  33. class="image"
  34. src="https://mxys.chuanghai-tech.com/wmfile/20240904/05af7c5442bb4a8baa1f5f3071ca2302.jpg"
  35. style="margin-left: 20px"
  36. @click="clickImg(item)"
  37. ></image>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 购买须知 -->
  42. <view class="xuzhi">
  43. <view class="title title1">购买须知</view>
  44. <view class="title title2" style="margin-top: 10rpx; padding-bottom: 20rpx">
  45. <view class="cicle"></view>
  46. <view style="margin-left: 16rpx">此套餐仅限用于女生,如男生请选其他合适的套餐</view>
  47. </view>
  48. </view>
  49. <!-- 购买 -->
  50. <view class="goorder">
  51. <view class="goods_price">¥{{ info.price }}</view>
  52. <view class="goorder_but" @click="toGou">立即购买</view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. id: '',
  61. info: {}
  62. }
  63. },
  64. onLoad(options) {
  65. this.id = options.id
  66. this.getDetail()
  67. },
  68. methods: {
  69. getDetail() {
  70. this.$Request.getT(`/app/lover-set/${this.id}`).then((res) => {
  71. console.log(res, 966)
  72. this.info = res.data
  73. })
  74. },
  75. //立即购买
  76. toGou() {
  77. uni.navigateTo({
  78. url: '/my/qinglv/orderX'
  79. })
  80. },
  81. //图片点击放大
  82. clickImg(img) {
  83. console.log(img)
  84. uni.previewImage({
  85. urls: [img], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  86. current: '', // 当前显示图片的http链接,默认是第一个
  87. success: function (res) {},
  88. fail: function (res) {},
  89. complete: function (res) {}
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. .content {
  97. width: 100%;
  98. height: 100%;
  99. background-color: #f2f2f2;
  100. }
  101. .title {
  102. margin: 13rpx 0 0 23rpx;
  103. font-size: 32rpx;
  104. font-weight: 500;
  105. color: rgba(0, 0, 0, 1);
  106. }
  107. .beizhu {
  108. margin: 23rpx 0 0 22rpx;
  109. width: 518rpx;
  110. height: 77rpx;
  111. background-size: 100%;
  112. background-image: url('https://mxys.chuanghai-tech.com/wmfile/20250812/7b77b0772b6e4c2cb8c0d3a012c7722b.png');
  113. font-size: 24rpx;
  114. font-weight: 400;
  115. line-height: 77rpx;
  116. text-align: center;
  117. color: rgba(255, 87, 51, 1);
  118. }
  119. /* //套餐内容 */
  120. .neirong {
  121. width: 100%;
  122. height: 100%;
  123. background-color: #ffffff;
  124. }
  125. .title1 {
  126. margin: 14rpx 0 0 19rpx;
  127. }
  128. .cicle {
  129. margin: 12rpx 0 0 0;
  130. width: 10rpx;
  131. height: 10rpx;
  132. background: #cccccc;
  133. border-radius: 50%;
  134. }
  135. .title2 {
  136. display: flex;
  137. font-size: 28rpx;
  138. }
  139. .xiangnei {
  140. width: 633rpx;
  141. display: flex;
  142. /* 让子元素两端对齐,价格居左,按钮居右 */
  143. justify-content: space-between;
  144. /* 垂直方向居中(可选,根据需求调整) */
  145. margin: 0 0 0 45rpx;
  146. padding-bottom: 10rpx;
  147. font-size: 24rpx;
  148. color: rgba(102, 102, 102, 1);
  149. }
  150. /* 菜品图片 */
  151. .shop_zheng {
  152. background-color: rgba(255, 255, 255, 1);
  153. width: 100%;
  154. margin-left: 20rpx;
  155. margin-top: 8px;
  156. height: 100%;
  157. overflow: hidden;
  158. }
  159. .image-container {
  160. width: 350px;
  161. overflow-x: auto;
  162. padding: 10rpx 0 10rpx 0;
  163. white-space: nowrap;
  164. /* transition: transform 0.3s; /* 可以添加平滑滑动的效果 */
  165. }
  166. .image {
  167. display: inline-block;
  168. width: 166rpx; /* 三张图片平分宽度 */
  169. height: 133rpx;
  170. }
  171. /* 购买须知 */
  172. .xuzhi {
  173. width: 100%;
  174. height: 100%;
  175. background-color: #ffffff;
  176. }
  177. /* 购买 */
  178. .goorder {
  179. display: flex;
  180. /* 让子元素两端对齐,价格居左,按钮居右 */
  181. justify-content: space-between;
  182. /* 垂直方向居中(可选,根据需求调整) */
  183. align-items: center;
  184. height: 123rpx;
  185. opacity: 1;
  186. box-shadow: 0px 0px 17px #000000;
  187. width: 100%;
  188. padding: 2% 3%;
  189. position: fixed;
  190. bottom: 0;
  191. background-color: #ffffff;
  192. z-index: 999;
  193. }
  194. .goods_price {
  195. font-size: 40rpx;
  196. font-weight: 500;
  197. color: rgba(255, 91, 26, 1);
  198. }
  199. .goorder_but {
  200. width: 224rpx;
  201. height: 76rpx;
  202. opacity: 1;
  203. border-radius: 104rpx;
  204. background: linear-gradient(90deg, #fcb147 0%, #ff9029 100%);
  205. line-height: 76rpx;
  206. text-align: center;
  207. font-weight: 700;
  208. }
  209. </style>