index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. export default {
  60. data() {
  61. return {
  62. toOrderButton: {
  63. borderRadius:'100rpx',
  64. fontSize:'30rpx',
  65. width: '180rpx',
  66. height: '60rpx'
  67. }
  68. };
  69. },
  70. onLoad() {
  71. this.getLocation()
  72. },
  73. methods: {
  74. // 获取用户位置
  75. getLocation() {
  76. uni.getLocation({
  77. type: 'gcj02',
  78. success: (res) => {
  79. console.log(res, 'location success')
  80. },
  81. // 定位失败默认展示青海西宁位置地图
  82. fail: (err) => {
  83. console.log(err,'location error')
  84. }
  85. });
  86. },
  87. //立即下单
  88. toPay(){
  89. },
  90. //修改收货地址信息
  91. editAddress(){
  92. uni.navigateTo({
  93. url:"/pages/toOrder/editAddress"
  94. })
  95. }
  96. },
  97. }
  98. </script>
  99. <style lang="scss">
  100. page{
  101. height: 100%;
  102. }
  103. .cart-pages{
  104. width: 100%;
  105. height: 100%;
  106. display: flex;
  107. flex-direction: column;
  108. .cart-bar{
  109. background: #FFFFFF;
  110. border-bottom: 1px solid #F8F8F8;
  111. border-top: 10upx solid #F8F8F8;
  112. display: flex;
  113. align-items: center;
  114. padding:15upx 20upx;
  115. .position{
  116. flex-grow: 1;
  117. }
  118. > view{
  119. padding: 10upx;
  120. .address{
  121. padding: 5upx 0;
  122. }
  123. &:last-child{
  124. padding: 0 20upx;
  125. }
  126. }
  127. }
  128. .goods-list{
  129. padding: 20upx 0;
  130. flex-grow: 1;
  131. overflow: auto;
  132. .goods-class-box{
  133. background: #FFFFFF;
  134. box-shadow: 1px 1px 3px #eee;
  135. margin-bottom: 20upx;
  136. }
  137. .goods-item{
  138. padding: 20upx 40upx;
  139. display: flex;
  140. align-items: center;
  141. justify-content: space-between;
  142. border-bottom: 1px solid #F8F8F8;
  143. background: #fff;
  144. &:last-child{
  145. border: 0;
  146. }
  147. .goods-imgs{
  148. position: relative;
  149. }
  150. .goods-info{
  151. padding-left: 20upx;
  152. .good-name{
  153. font-weight: bold;
  154. }
  155. }
  156. .goods-price{
  157. display: flex;
  158. align-items: center;
  159. justify-content: space-between;
  160. padding-top: 20upx;
  161. >view{
  162. &:first-child{
  163. display: flex;
  164. align-items: center;
  165. text{
  166. color: red;
  167. font-size: 35upx;
  168. margin-right: 6upx;
  169. font-weight: bold;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. .goods-heji{
  177. padding: 20upx 40upx;
  178. background: #FFFFFF;
  179. box-shadow: 1px 1px 3px #eee;
  180. margin-top: 20upx;
  181. >view{
  182. display: flex;
  183. align-items: center;
  184. justify-content: space-between;
  185. padding: 10upx 0;
  186. .heji{
  187. display: flex;
  188. align-items: center;
  189. text{
  190. color: red;
  191. margin-right: 6upx;
  192. font-size: 35upx;
  193. font-weight: bold;
  194. }
  195. }
  196. }
  197. }
  198. .cart-submit{
  199. padding: 20upx 30upx;
  200. background: #FFFFFF;
  201. box-shadow: 1px 1px 3px #eee;
  202. border-top: 1px solid #eee;
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. > view{
  207. &:first-child{
  208. display: flex;
  209. align-items: center;
  210. text{
  211. color: red;
  212. font-size: 40upx;
  213. margin-right: 6upx;
  214. font-weight: bold;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. </style>