index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="cart-pages">
  3. <view class="cart-bar">
  4. <view>
  5. <u-image height="40rpx" width="40rpx" src="/static/position.png"></u-image>
  6. </view>
  7. <view class="position">
  8. <view class="address">陕西省西安市未央区华帝金座A座6楼</view>
  9. <view>王明 1456465455</view>
  10. </view>
  11. <view @click="editAddress">
  12. <u-image height="50rpx" width="50rpx" src="/static/edit.png"></u-image>
  13. </view>
  14. </view>
  15. <view class="goods-list">
  16. <!-- 商品列表 -->
  17. <view class="goods-item" v-for="(item,index) in 6" :key="index">
  18. <view class="goods-imgs">
  19. <u-image border-radius="12" width="158rpx" height="140rpx" src="/static/goods.png"></u-image>
  20. </view>
  21. <view class="goods-info">
  22. <view class="good-name">拉就是两地分居拉进来就是两地分居拉进来就是两地分居拉进来进来</view>
  23. <view class="goods-price">
  24. <view>
  25. <text>50</text>
  26. <u-image mode="scaleToFill" width="35rpx" height="35rpx" src="/static/ledou.png"></u-image>
  27. </view>
  28. <view>×2</view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 总计 -->
  33. <view class="goods-heji">
  34. <view>
  35. <view>商品合计:</view>
  36. <view class="heji">
  37. <text>250</text>
  38. <u-image mode="scaleToFill" width="35rpx" height="35rpx" src="/static/ledou.png"></u-image>
  39. </view>
  40. </view>
  41. <view>
  42. <view>运费:</view>
  43. <view>免运费</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="cart-submit">
  48. <view>
  49. <view>总计:<text>450</text></view>
  50. <u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
  51. </view>
  52. <view>
  53. <u-button size="mini" :custom-style="toOrderButton" type="error" @click="toPay">确认支付</u-button>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. findAddressBycustomerNo
  61. } from '@/api/receiveAddress.js'
  62. export default {
  63. data() {
  64. return {
  65. toOrderButton: {
  66. borderRadius:'100rpx',
  67. fontSize:'30rpx',
  68. width: '180rpx',
  69. height: '60rpx'
  70. }
  71. };
  72. },
  73. onLoad() {
  74. this.getLocation()
  75. },
  76. methods: {
  77. // 获取用户位置
  78. getLocation() {
  79. findAddressBycustomerNo().then(res => {
  80. console.log(res)
  81. })
  82. },
  83. //立即下单
  84. toPay(){
  85. },
  86. //修改收货地址信息
  87. editAddress(){
  88. uni.navigateTo({
  89. url:"/pages/toOrder/editAddress"
  90. })
  91. }
  92. },
  93. }
  94. </script>
  95. <style lang="scss">
  96. page{
  97. height: 100%;
  98. }
  99. .cart-pages{
  100. width: 100%;
  101. height: 100%;
  102. display: flex;
  103. flex-direction: column;
  104. .cart-bar{
  105. background: #FFFFFF;
  106. border-bottom: 1px solid #F8F8F8;
  107. border-top: 10upx solid #F8F8F8;
  108. display: flex;
  109. align-items: center;
  110. padding:15upx 20upx;
  111. .position{
  112. flex-grow: 1;
  113. }
  114. > view{
  115. padding: 10upx;
  116. .address{
  117. padding: 5upx 0;
  118. }
  119. &:last-child{
  120. padding: 0 20upx;
  121. }
  122. }
  123. }
  124. .goods-list{
  125. padding: 20upx 0;
  126. flex-grow: 1;
  127. overflow: auto;
  128. .goods-class-box{
  129. background: #FFFFFF;
  130. box-shadow: 1px 1px 3px #eee;
  131. margin-bottom: 20upx;
  132. }
  133. .goods-item{
  134. padding: 20upx 40upx;
  135. display: flex;
  136. align-items: center;
  137. justify-content: space-between;
  138. border-bottom: 1px solid #F8F8F8;
  139. background: #fff;
  140. &:last-child{
  141. border: 0;
  142. }
  143. .goods-imgs{
  144. position: relative;
  145. }
  146. .goods-info{
  147. padding-left: 20upx;
  148. .good-name{
  149. font-weight: bold;
  150. }
  151. }
  152. .goods-price{
  153. display: flex;
  154. align-items: center;
  155. justify-content: space-between;
  156. padding-top: 20upx;
  157. >view{
  158. &:first-child{
  159. display: flex;
  160. align-items: center;
  161. text{
  162. color: red;
  163. font-size: 35upx;
  164. margin-right: 6upx;
  165. font-weight: bold;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. .goods-heji{
  173. padding: 20upx 40upx;
  174. background: #FFFFFF;
  175. box-shadow: 1px 1px 3px #eee;
  176. margin-top: 20upx;
  177. >view{
  178. display: flex;
  179. align-items: center;
  180. justify-content: space-between;
  181. padding: 10upx 0;
  182. .heji{
  183. display: flex;
  184. align-items: center;
  185. text{
  186. color: red;
  187. margin-right: 6upx;
  188. font-size: 35upx;
  189. font-weight: bold;
  190. }
  191. }
  192. }
  193. }
  194. .cart-submit{
  195. padding: 20upx 30upx;
  196. background: #FFFFFF;
  197. box-shadow: 1px 1px 3px #eee;
  198. border-top: 1px solid #eee;
  199. display: flex;
  200. align-items: center;
  201. justify-content: space-between;
  202. > view{
  203. &:first-child{
  204. display: flex;
  205. align-items: center;
  206. text{
  207. color: red;
  208. font-size: 40upx;
  209. margin-right: 6upx;
  210. font-weight: bold;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>