gameList.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <view>
  3. <!-- <u-dropdown height="80" active-color="#2B7DE2" inactive-color='#fff' >
  4. <u-dropdown-item v-model="value1" title="智能优选" @change="change" :options="options1"></u-dropdown-item>
  5. <u-dropdown-item v-model="value2" title="不限性别" @change="change" :options="options2"></u-dropdown-item>
  6. <u-dropdown-item v-model="value3" title="价格" @change="change" :options="options3"></u-dropdown-item>
  7. </u-dropdown> -->
  8. <ren-dropdown-filter :filterData='filterData' :border="false" :defaultIndex='defaultIndex' @onSelected='change'
  9. class="u-skeleton-rect">
  10. </ren-dropdown-filter>
  11. <view class="margin-lr-sm" v-if="orderList.length">
  12. <view class="flex margin-bottom-sm bg padding-sm radius" v-for="(item,index) in orderList" :key='item.id'
  13. @click="goOrder(item)">
  14. <!-- <image :src="item.headImg?item.headImg: '../../../static/logo.png'"
  15. style="width: 220rpx;height: 200rpx;border-radius: 10rpx;">
  16. </image> -->
  17. <view style="width: 220upx;height: 160upx;border-radius: 10rpx;">
  18. <image :src="item.headImg?item.headImg: '../../static/logo.png'"
  19. style="width: 220upx;height: 160upx;"></image>
  20. </view>
  21. <view class=" margin-left-sm text-white flex-direction" style="width: 65%;">
  22. <view class="flex justify-between">
  23. <view class="flex">
  24. <image src="../../../static/images/geren.png"
  25. style="width: 35rpx;height: 35rpx;margin-left: 10rpx;"></image>
  26. <!-- <view class="margin-right-xs u-line-1"
  27. style="margin-top: -2px;display: inline-block;width: 320upx; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  28. {{item.myLevel}}
  29. </view> -->
  30. <view class="text-bold text-df margin-left-xs">大美女</view>
  31. </view>
  32. <view style="color: #999999;">1.5km</view>
  33. </view>
  34. <!-- <view style="color: #999999;font-size: 24rpx;line-height: 40rpx;" v-if="item.authentication == 1">
  35. <text v-if="item.sex == 1">女</text>
  36. <text v-if="item.sex == 0">男</text>
  37. /<text>{{age}}岁</text>
  38. /<text>{{item.orderLevel}}</text>
  39. /<text >{{item.region}}</text>
  40. </view>
  41. <view style="color: #999999;" v-if="item.authentication == 2">
  42. <text>{{item.name}}</text> /<text>{{item.region}}</text>
  43. </view> -->
  44. <view class="flex flex-wrap" style="margin-top: 10rpx;">
  45. <text class="margin-bottom-xs box" v-for="(item,index) in item.gameName"
  46. :key="index">{{item}}</text>
  47. </view>
  48. <view class="text-cut" style="color: #999999;">{{item.describes}}</view>
  49. <!-- <view style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
  50. <view style="color:#FF1200;font-size: 31rpx;">
  51. ¥{{item.oldMoney}}/月
  52. </view>
  53. <view style="background: #557EFD;color: #ffffff;padding: 15rpx 25rpx;border-radius: 15rpx;">
  54. 预约服务
  55. </view>
  56. </view> -->
  57. </view>
  58. </view>
  59. </view>
  60. <empty v-if="orderList.length == 0"></empty>
  61. </view>
  62. </template>
  63. <script>
  64. import empty from '@/components/empty.vue'
  65. export default {
  66. components: {
  67. empty
  68. },
  69. data() {
  70. return {
  71. page: 1,
  72. limit: 10,
  73. gameId: '',
  74. gameName: '',
  75. value1: '',
  76. value2: '',
  77. value3: '',
  78. defaultIndex: [0, 0, 0],
  79. filterData: [
  80. [{
  81. label: '智能优选',
  82. value: '',
  83. },
  84. {
  85. label: '距离优先',
  86. value: 3,
  87. },
  88. {
  89. label: '人气优先',
  90. value: 2,
  91. },
  92. {
  93. label: '同城',
  94. value: 1,
  95. }
  96. ],
  97. [{
  98. label: '类别',
  99. value: '0',
  100. },
  101. {
  102. label: '女',
  103. value: '2',
  104. },
  105. {
  106. label: '男',
  107. value: '1',
  108. }
  109. ],
  110. [{
  111. label: '价格',
  112. value: '',
  113. },
  114. {
  115. label: '从远到近',
  116. value: 'desc',
  117. },
  118. {
  119. label: '从近到远',
  120. value: 'asc',
  121. }
  122. ],
  123. ],
  124. options1: [{
  125. label: '智能排序',
  126. value: '',
  127. },
  128. {
  129. label: '距离优先',
  130. value: 3,
  131. },
  132. {
  133. label: '人气优先',
  134. value: 2,
  135. },
  136. {
  137. label: '同城',
  138. value: 1,
  139. }
  140. ],
  141. options2: [{
  142. label: '类别',
  143. value: '0',
  144. },
  145. {
  146. label: '女',
  147. value: '2',
  148. },
  149. {
  150. label: '男',
  151. value: '1',
  152. }
  153. ],
  154. options3: [{
  155. label: '价格',
  156. value: '',
  157. },
  158. {
  159. label: '从远到近',
  160. value: 'desc',
  161. },
  162. {
  163. label: '从近到远',
  164. value: 'asc',
  165. }
  166. ],
  167. city: null,
  168. sex: null,
  169. order: null,
  170. latitude: null,
  171. longitude: null,
  172. orderList: [],
  173. token: '',
  174. isVip: false,
  175. myId: '',
  176. age: 0,
  177. birthDate: ''
  178. }
  179. },
  180. onLoad(option) {
  181. uni.setNavigationBarTitle({
  182. title: option.name
  183. })
  184. this.gameId = option.gameId
  185. this.gameName = option.name;
  186. this.city = uni.getStorageSync('city')
  187. this.latitude = uni.getStorageSync('latitude')
  188. this.longitude = uni.getStorageSync('longitude')
  189. this.token = uni.getStorageSync('token')
  190. this.isVip = uni.getStorageSync('isVIP') ? uni.getStorageSync('isVIP') : false
  191. this.myId = uni.getStorageSync('userId')
  192. this.getDataList()
  193. },
  194. methods: {
  195. //换算年龄
  196. getAge(e) {
  197. console.log('出生日期:' + e)
  198. this.birthDate = e
  199. //创建系统日期
  200. var today = new Date();
  201. //把出生日期转换成日期
  202. this.birthDate = new Date(this.birthDate);
  203. //分别获取到年份后相减
  204. this.age = today.getFullYear() - this.birthDate.getFullYear();
  205. // console.log(this.age+'当前年龄')
  206. },
  207. // 筛选
  208. change(e) {
  209. console.log(e[0][0], '+++++++++')
  210. this.page = 1
  211. this.value1 = e[0][0].value
  212. this.value2 = e[1][0].value
  213. this.value3 = e[2][0].value
  214. this.getDataList()
  215. },
  216. getDataList() {
  217. let data = {
  218. massageTypeId: this.gameName,
  219. page: this.page,
  220. limit: this.limit,
  221. isRecommend: 2,
  222. condition: this.value1, //智能优选
  223. authentication: this.value2, //不限男女
  224. by: this.value3, //价格
  225. latitude: this.latitude,
  226. longitude: this.longitude,
  227. city: this.city
  228. }
  229. // console.log(data)
  230. if (this.token) {
  231. this.$Request.get("/app/orderTaking/queryTaking", data).then(res => {
  232. if (res.code == 0) {
  233. if (this.page == 1) {
  234. this.orderList = res.data.list
  235. for (let i = 0; i < this.orderList.length; i++) {
  236. this.orderList[i].gameName = this.orderList[i].gameName.split(",");
  237. // console.log(this.orderList[i].region)
  238. if (this.orderList[i].region) {
  239. let region = this.orderList[i].region.split(",");
  240. this.orderList[i].region = region[1]
  241. } else {
  242. this.orderList[i].region = '不限地区'
  243. }
  244. this.getAge(this.orderList[i].birthdate)
  245. }
  246. } else {
  247. this.orderList = [...this.orderList, ...res.data.list]
  248. for (let i = 0; i < this.orderList.length; i++) {
  249. this.orderList[i].gameName = this.orderList[i].gameName.split(",");
  250. if (this.orderList[i].region) {
  251. let region = this.orderList[i].region.split(",");
  252. this.orderList[i].region = region[1]
  253. } else {
  254. this.orderList[i].region = '不限地区'
  255. }
  256. this.getAge(this.orderList[i].birthdate)
  257. }
  258. }
  259. }
  260. uni.stopPullDownRefresh();
  261. })
  262. } else {
  263. this.$Request.get("/app/orderTaking/queryTakings", data).then(res => {
  264. if (res.code == 0) {
  265. if (this.page == 1) {
  266. this.orderList = res.data.list
  267. for (let i = 0; i < this.orderList.length; i++) {
  268. this.orderList[i].gameName = this.orderList[i].gameName.split(",");
  269. if (this.orderList[i].region) {
  270. let region = this.orderList[i].region.split(",");
  271. this.orderList[i].region = region[1]
  272. } else {
  273. this.orderList[i].region = '不限地区'
  274. }
  275. this.getAge(this.orderList[i].birthdate)
  276. }
  277. } else {
  278. this.orderList = [...this.orderList, ...res.data.list]
  279. for (let i = 0; i < this.orderList.length; i++) {
  280. this.orderList[i].gameName = this.orderList[i].gameName.split(",");
  281. if (this.orderList[i].region) {
  282. let region = this.orderList[i].region.split(",");
  283. this.orderList[i].region = region[1]
  284. } else {
  285. this.orderList[i].region = '不限地区'
  286. }
  287. this.getAge(this.orderList[i].birthdate)
  288. }
  289. }
  290. }
  291. uni.stopPullDownRefresh();
  292. })
  293. }
  294. },
  295. // change(value) {
  296. // this.getDataList()
  297. // },
  298. // 跳转订单
  299. goOrder(e) {
  300. if (this.token) {
  301. uni.navigateTo({
  302. url: '/pages/index/order/order?id=' + e.id
  303. });
  304. } else {
  305. uni.navigateTo({
  306. url: '/pages/public/login'
  307. });
  308. }
  309. },
  310. },
  311. onReachBottom: function() {
  312. this.page = this.page + 1;
  313. this.getDataList();
  314. },
  315. onPullDownRefresh: function() {
  316. this.page = 1;
  317. this.getDataList();
  318. },
  319. }
  320. </script>
  321. <style>
  322. page {
  323. background-color: #F5F5F5;
  324. }
  325. .bg {
  326. background: #ffffff;
  327. }
  328. .line_s {
  329. display: inline-flex;
  330. width: 10rpx;
  331. height: 10rpx;
  332. background: #1AD566;
  333. border-radius: 50%;
  334. margin-right: 10rpx;
  335. }
  336. .line_x {
  337. display: inline-flex;
  338. width: 10rpx;
  339. height: 10rpx;
  340. background: #000000;
  341. border-radius: 50%;
  342. margin-right: 10rpx;
  343. }
  344. .box {
  345. background: #E8FAE1;
  346. color: #2FB57A;
  347. padding: 5rpx 15rpx;
  348. font-size: 26rpx;
  349. letter-spacing: 2rpx;
  350. border-radius: 8rpx;
  351. margin-right: 8upx;
  352. }
  353. </style>