sureBuy.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view>
  3. <van-radio-group >
  4. <van-cell-group
  5. v-for="(item, index) in list"
  6. :key="index"
  7. >
  8. <van-cell
  9. :border="false"
  10. :title="item.title"
  11. @click="onChange(index)"
  12. >
  13. <template slot="right-icon">
  14. <van-radio-group style="width: 20upx;" :value="radio" >
  15. <van-radio checked-color="#D9332E" :name="index" >
  16. </van-radio>
  17. </van-radio-group>
  18. </template>
  19. </van-cell>
  20. </van-cell-group>
  21. </van-radio-group>
  22. <view v-if="radio === 0"
  23. style="border-top: 15upx solid #F5F5F5;
  24. border-bottom: 15upx solid #F5F5F5;
  25. "
  26. >
  27. <van-field
  28. :value="username"
  29. label="酒店"
  30. placeholder="请输入酒店"
  31. />
  32. <van-field
  33. :value="username"
  34. label="房间号"
  35. placeholder="请输入房间号"
  36. />
  37. <van-field
  38. :value="username"
  39. label="收货人"
  40. placeholder="请输入收货人"
  41. />
  42. <van-field
  43. :value="username"
  44. label="手机号"
  45. placeholder="请输入手机号"
  46. />
  47. </view>
  48. <view v-if="radio === 2"
  49. style="border-top: 15upx solid #F5F5F5;
  50. border-bottom: 15upx solid #F5F5F5;
  51. "
  52. >
  53. <van-field
  54. :value="username"
  55. label="预定酒店"
  56. placeholder="请输入预定酒店"
  57. />
  58. <van-field
  59. :value="username"
  60. label="入住人"
  61. placeholder="请输入入住人"
  62. />
  63. <van-field
  64. :value="username"
  65. label="手机号"
  66. placeholder="请输入手机号"
  67. />
  68. <van-field
  69. :value="username"
  70. label="备注"
  71. placeholder="请输入备注"
  72. />
  73. </view>
  74. <van-cell v-if="radio === 1&&choseadress == '' " @click="goAdress" class="LinkAdress" title="选择地址" is-link/>
  75. <view v-if="radio === 1&&choseadress != ''" class="wrapper">
  76. <view class="u-box" @click="goAdress" >
  77. <text class="name" style="padding-right: 20upx;">{{choseadress.address_realname}}</text>
  78. <text class="mobile">{{choseadress.address_mob_phone}}</text>
  79. </view>
  80. <view class="u-box">
  81. <text class="address">{{choseadress.area_info}} {{choseadress.address_detail}}</text>
  82. </view>
  83. </view>
  84. <view @tap="goDetail()" class="cart-list">
  85. <view class="topTip">
  86. <view style="display: flex;align-items: center;border-bottom: 1px solid #F5F5F5;">
  87. <image :src="pictureUrl+'/uploads/home/store/'+store.store_id+'/'+store.store_logo" style="border-radius: 50%;
  88. width: 50upx;height: 50upx;"></image>
  89. <span style="padding-left: 8upx;">{{store.store_name}}</span>
  90. </view>
  91. </view>
  92. <view v-for="(item,index) in pricelist" :key="index" class="shoplist" style="background-color: #fff;">
  93. <view>
  94. <van-card
  95. title-class="changewidth"
  96. price-class ="priceClass"
  97. :price="item.goods_price"
  98. :desc="item.desarray[1]+'X'+item.goods_num"
  99. :title="item.desarray[0]"
  100. :thumb="pictureUrl + '/uploads/home/store/goods/' + item.goods_image.substr(0, item.goods_image.indexOf('\_')) + '/' + item.goods_image"
  101. >
  102. </van-card>
  103. </view>
  104. </view>
  105. <view class="topTip" v-if="radio === 1">
  106. <view style="font-size: 28upx;">运费:{{ralodprice}}</view>
  107. </view>
  108. </view>
  109. <!-- 底部付款 -->
  110. <view class="adressbutton">
  111. <view class="buttonStatus">
  112. <view @click="estimate" class="deleteOrder">应付<span>¥{{prices}}</span></view>
  113. <view class="payOrder" @click="goPay">付款</view>
  114. </view>
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. export default {
  120. data() {
  121. return {
  122. ralodprice: 0,
  123. prices:'',
  124. pictureUrl: this.pictureUrl,
  125. list:[
  126. {title:'请送到我的房间'},
  127. {title:'快递到我的地址'},
  128. {title:'处理我的客房预定'}
  129. ],
  130. username:'',
  131. radio: 0,
  132. store: {},
  133. pricelist: [],
  134. choseadress: '',
  135. order_id:''
  136. }
  137. },
  138. onLoad(options) {
  139. console.log(options);
  140. this.order_id = options.order_id;
  141. this.store = JSON.parse(options.store);
  142. this.pricelist = JSON.parse(options.pricelist);
  143. let prices = Number((options.prices/100).toFixed(2));
  144. this.prices = prices;
  145. uni.$on("getadress",(adress)=>{
  146. this.choseadress = adress;
  147. console.log(this.choseadress)
  148. this.address_id = this.choseadress.address_id;
  149. this.getralodprice();
  150. })
  151. },
  152. methods: {
  153. // 核算运费
  154. getralodprice() {
  155. this.request({
  156. url: '/v2/entry/orderFreight',
  157. method: 'POST',
  158. data: {
  159. }
  160. })
  161. },
  162. onChange(index) {
  163. this.radio = index;
  164. },
  165. goAdress() {
  166. console.log("dddd")
  167. uni.navigateTo({
  168. url: '../myOrder/adress',
  169. });
  170. }
  171. }
  172. }
  173. </script>
  174. <style lang="scss">
  175. .LinkAdress /deep/ .van-cell {
  176. border-top: 15upx solid #F5F5F5;
  177. border-bottom: 15upx solid #F5F5F5;
  178. }
  179. .wrapper{
  180. border-top: 15rpx solid #F5F5F5;
  181. border-bottom: 15rpx solid #F5F5F5;
  182. padding: 0 32upx;
  183. }
  184. .u-box {
  185. padding: 15upx 0;
  186. }
  187. .topTip {
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. padding: 20upx 36upx;
  192. border-bottom: 1px solid #F5F5F5;
  193. }
  194. .changewidth {
  195. color: #303133;
  196. font-size: 32upx;
  197. font-weight: 100!important;
  198. }
  199. .priceClass {
  200. color:#303133!important;
  201. font-weight: 100!important;
  202. font-size: 36upx;
  203. }
  204. .van-card {
  205. background-color: #fff!important;
  206. }
  207. .shoplist {
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. }
  212. .adressbutton {
  213. position: fixed;
  214. bottom: 0;
  215. width: 100%;
  216. .buttonStatus {
  217. display: flex;
  218. text-align: left;
  219. .deleteOrder {
  220. flex: 3;
  221. color: #303133;
  222. font-size: 32upx;
  223. background-color: #fff;
  224. padding: 10px 0;
  225. }
  226. .payOrder {
  227. flex: 1;
  228. font-size: 32upx;
  229. color: #fff;
  230. background-color: #D9332E;
  231. padding: 10px 0;
  232. text-align: center;
  233. }
  234. }
  235. }
  236. </style>