my-publish.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="container">
  3. <z-paging
  4. ref="paging"
  5. v-model="dataList"
  6. @query="queryList"
  7. style="padding-top: 10px"
  8. >
  9. <template slot="top">
  10. <u-navbar bgColor="#D6DDFF" :autoBack="true" :placeholder="true">
  11. <view class="u-nav-slot-center" slot="center">
  12. <text
  13. class="u-navbar__content__left__text"
  14. style="color: #000; font-size: 34rpx; font-weight: 600"
  15. >我的发布</text
  16. >
  17. </view>
  18. </u-navbar>
  19. </template>
  20. <view class="list-wrap2">
  21. <u-radio-group
  22. v-model="radiovalue"
  23. placement="column"
  24. @change="radioChange"
  25. >
  26. <view
  27. class="item text-16 color-333 text-500"
  28. v-for="(item, index) in dataList"
  29. :key="index"
  30. >
  31. <view class="item" v-if="item.type == 1">
  32. <view
  33. style="display: flex; flex-direction: row; align-items: center"
  34. >
  35. <u-radio shape="circle" :name="item.id" activeColor="#4D65FF">
  36. </u-radio>
  37. <view class="contont" @click="houseDetai(item)">
  38. <img
  39. :src="item.coverImg ? item.coverImg : ''"
  40. style="width: 100px; height: 100px"
  41. />
  42. <view class="right">
  43. <view class="titles">
  44. <view class="name"> {{ item.title }} </view>
  45. </view>
  46. <view
  47. class="info"
  48. style="width: 100%; justify-content: flex-start"
  49. >
  50. <u-tag
  51. style="margin-right: 10rpx"
  52. :text="items"
  53. plain
  54. size="mini"
  55. v-for="(items, index) in item.skill
  56. ? item.skill.split(',')
  57. : []"
  58. :key="index"
  59. ></u-tag>
  60. </view>
  61. <view
  62. class="info"
  63. style="width: 100%; justify-content: space-between"
  64. >
  65. <text>{{
  66. item.experienceRange == 0
  67. ? "1年以下"
  68. : item.experienceRange == 1
  69. ? "1-3年"
  70. : item.experienceRange == 2
  71. ? "3-5年"
  72. : item.experienceRange == 3
  73. ? "5年以上"
  74. : ""
  75. }}</text>
  76. | <text>{{ item.age }}岁</text> |
  77. <text>{{ item.nativePlace.substring(0, 3) }}人</text>|
  78. <text>{{
  79. item.atHome == 0
  80. ? "住家"
  81. : item.atHome == 1
  82. ? "不住家"
  83. : item.atHome == 2
  84. ? "白班"
  85. : item.atHome == 3
  86. ? "钟点工"
  87. : ""
  88. }}</text>
  89. </view>
  90. <view class="intro"> {{ item.intro }} </view>
  91. <!-- <view class="time"> 发布时间{{ item.createTime }} </view> -->
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="item" :key="index" v-if="item.type == 0">
  97. <view
  98. style="display: flex; flex-direction: row; align-items: center"
  99. >
  100. <u-radio shape="circle" :name="item.id" activeColor="#4D65FF">
  101. </u-radio>
  102. <view class="contont" @click="houseDetai(item)">
  103. <img
  104. :src="item.coverImg ? item.coverImg : ''"
  105. style="width: 120px; height: 125px"
  106. />
  107. <view class="right">
  108. <view class="titles">
  109. <view class="name"> {{ item.title }} </view>
  110. </view>
  111. <view class="intro"> {{ item.intro }} </view>
  112. <!-- <view class="time"> 发布时间{{ item.createTime }} </view> -->
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </u-radio-group>
  119. </view>
  120. </z-paging>
  121. <view
  122. @click="sendHandle"
  123. v-debounce
  124. class="operate-fixed qzy-space-between-center"
  125. >
  126. <u-button
  127. :disabled="!radiovalue ? true : false"
  128. color="linear-gradient( 97deg, #4D65FF 0%, #6F91FF 100%)"
  129. >发送</u-button
  130. >
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. export default {
  136. components: {},
  137. data() {
  138. return {
  139. radiovalue: "",
  140. houseId: "",
  141. dataList: [],
  142. userId: "",
  143. queryParams: {
  144. currPage: 1,
  145. pageSize: 10,
  146. status: 1,
  147. },
  148. };
  149. },
  150. onLoad(options) {
  151. this.userId = options.userId;
  152. },
  153. methods: {
  154. queryList(currPage, pageSize) {
  155. this.queryParams.currPage = currPage;
  156. this.queryParams.pageSize = pageSize;
  157. this.$refs.paging.complete([]);
  158. this.api
  159. .hmGoodsList(this.queryParams)
  160. .then((res) => {
  161. if (res.code == 200) {
  162. this.$refs.paging.complete(res.data.list);
  163. }
  164. })
  165. .catch((err) => {
  166. this.$refs.paging.complete(false);
  167. uni.$u.toast("服务内部异常");
  168. });
  169. },
  170. sendHandle() {
  171. console.log(this.radiovalue);
  172. let params = {
  173. refId: this.radiovalue,
  174. isSend: 1,
  175. sendRefType: 1,
  176. status: -1,
  177. shopUserId: uni.getStorageSync("userId").substring(1),
  178. userId: this.userId,
  179. msgContent: {},
  180. sendType: 1,
  181. };
  182. this.api.sendMessage(params).then((res) => {
  183. if (res.code === 200) {
  184. uni.$u.toast("已发送~");
  185. setTimeout(() => {
  186. uni.navigateBack({
  187. delta: 1,
  188. });
  189. }, 1000);
  190. }
  191. });
  192. },
  193. },
  194. };
  195. </script>
  196. <style lang="scss" scoped>
  197. .container {
  198. background: #f4f4f4;
  199. height: 100%;
  200. }
  201. ::v-deep .search-box {
  202. height: 100rpx;
  203. padding: 0 24rpx;
  204. background: #fff;
  205. position: fixed;
  206. top: 0;
  207. width: 100%;
  208. box-sizing: border-box;
  209. z-index: 1000;
  210. .u-search {
  211. border-radius: 44rpx;
  212. border: 1.5px solid rgba(0, 181, 148, 0.5);
  213. }
  214. .publish {
  215. width: 120rpx;
  216. }
  217. image {
  218. width: 50rpx;
  219. height: 50rpx;
  220. }
  221. }
  222. .tab-box {
  223. padding: 10rpx 24rpx;
  224. background: #fff;
  225. margin: 0;
  226. position: relative;
  227. box-sizing: border-box;
  228. .manage {
  229. position: absolute;
  230. right: 24rpx;
  231. top: 24rpx;
  232. font-size: 28rpx;
  233. image {
  234. width: 32rpx;
  235. height: 32rpx;
  236. margin-top: -4rpx;
  237. }
  238. }
  239. .manage-active {
  240. color: #00b594;
  241. }
  242. }
  243. .operate-fixed {
  244. width: 100%;
  245. height: 120rpx;
  246. position: fixed;
  247. background: #fff;
  248. bottom: 0;
  249. padding: 0 24rpx;
  250. box-sizing: border-box;
  251. z-index: 100;
  252. }
  253. .list-wrap2 {
  254. .item {
  255. width: 95%;
  256. margin: auto auto 10px auto;
  257. background: #ffffff;
  258. border-radius: 15rpx;
  259. .header {
  260. padding: 20rpx 40rpx 20rpx 40rpx;
  261. height: 60rpx;
  262. display: flex;
  263. flex-direction: row;
  264. justify-content: space-between;
  265. align-items: center;
  266. .title {
  267. font-family: PingFangSC, PingFang SC;
  268. font-weight: bold;
  269. font-size: 34rpx;
  270. color: #333333;
  271. text-align: left;
  272. font-style: normal;
  273. display: flex;
  274. flex-direction: row;
  275. justify-content: center;
  276. align-items: center;
  277. .icon {
  278. width: 52rpx;
  279. height: 52rpx;
  280. margin-right: 5rpx;
  281. }
  282. }
  283. }
  284. .contont {
  285. // padding: 0px 40rpx;
  286. padding-top: 20rpx;
  287. display: flex;
  288. flex-direction: row;
  289. align-items: flex-start;
  290. .right {
  291. margin-left: 30rpx;
  292. line-height: 60rpx;
  293. width: 100%;
  294. }
  295. .price {
  296. margin-top: 10rpx;
  297. font-weight: bold;
  298. font-size: 40rpx;
  299. color: #ff2f2f;
  300. text-align: left;
  301. font-style: normal;
  302. }
  303. .time {
  304. font-weight: 500;
  305. font-size: 26rpx;
  306. color: #666666;
  307. text-align: left;
  308. font-style: normal;
  309. }
  310. .titles {
  311. width: 100%;
  312. display: flex;
  313. flex-direction: row;
  314. justify-content: flex-start;
  315. align-items: center;
  316. .tag {
  317. width: 75rpx;
  318. height: 45rpx;
  319. background: linear-gradient(270deg, #03f3a4 0%, #3ae2c4 100%);
  320. border-radius: 2rpx;
  321. text-align: center;
  322. color: white;
  323. display: flex;
  324. flex-direction: row;
  325. justify-content: center;
  326. align-items: center;
  327. }
  328. .name {
  329. margin-left: 5rpx;
  330. font-family: PingFang-SC, PingFang-SC;
  331. font-weight: bold;
  332. font-size: 37rpx;
  333. color: #333333;
  334. text-align: left;
  335. font-style: normal;
  336. }
  337. }
  338. .info {
  339. font-weight: 500;
  340. font-size: 28rpx;
  341. color: #666666;
  342. display: flex;
  343. flex-direction: row;
  344. justify-content: space-between;
  345. }
  346. }
  347. }
  348. }
  349. ::v-deep .z-paging-content {
  350. padding-bottom: 120rpx !important;
  351. }
  352. </style>