mypublish.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view>
  3. <view class="flex content1">
  4. <view class=" search-wrap">
  5. <view class="search flex justify-space-between align-item-center flex-between" @click="search">
  6. <view class="left flex align-item-center">
  7. <image class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;"
  8. src="@/static/image/card/search.png"></image>
  9. <view class="search-val"> {{searchVal?searchVal:'搜索店铺或服务 '}}</view>
  10. </view>
  11. <view class="right">
  12. <image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.stop="delSearchVal"
  13. src="@/static/image/card/searchdel.png" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback"
  19. @down="downCallback" :top="108">
  20. <view class='findItem' v-for='item in findList'>
  21. <view style='align-items: flex-start;' class='flex'>
  22. <view class="left">
  23. <view class='cover'>
  24. <u--image radius='4' :showLoading="true" :src="item.coverImage" width="86px"
  25. height="86px" @click="click"></u--image>
  26. </view>
  27. </view>
  28. <view class="right">
  29. <view class='flex'>
  30. <view class='flex'>
  31. <view class="main-body">
  32. {{item.mainBody=="商铺"?'商铺':'个人'}}
  33. </view>
  34. <view class='name'>{{item.shopNames}}</view>
  35. </view>
  36. <view>
  37. <!-- <view class='iconfont applet-androidgengduo'></view> -->
  38. </view>
  39. </view>
  40. <view class='description'>
  41. <mote-lines-divide :dt="item.serviceDescription" :line="3" expandText="展开"
  42. foldHint="收起" />
  43. </view>
  44. </view>
  45. </view>
  46. <view class='address flex justify-space-between'>
  47. <view class='flex'>
  48. <view class='iconfont applet-dizhi'></view>
  49. <view @click.stop="toShopDetail(item)">{{item.detailedAddress}}</view>
  50. </view>
  51. <view class='flex'>
  52. <view @click='edit(item)' class='default_button'>编辑</view>
  53. <view @click='del(item)' class='default_button'>删除</view>
  54. </view>
  55. </view>
  56. </view>
  57. </mescroll-uni>
  58. </view>
  59. </template>
  60. <script>
  61. var that
  62. import MoteLinesDivide from "@/components/text-over-flow/text-over-flow.vue"
  63. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  64. export default {
  65. components: {
  66. MoteLinesDivide,
  67. },
  68. mixins: [MescrollMixin],
  69. data() {
  70. return {
  71. searchVal:'',
  72. findList:[],
  73. handleList:[],
  74. curPageLen:0,
  75. totalPage:0,
  76. currectData:{},
  77. }
  78. },
  79. onLoad() {
  80. that = this
  81. },
  82. onShow() {
  83. if (uni.getStorageSync("search_val")) {
  84. this.searchVal = uni.getStorageSync("search_val")
  85. this.mescroll.resetUpScroll()
  86. }
  87. },
  88. methods: {
  89. edit(item){
  90. uni.navigateTo({
  91. url: "/pageA/find/edit?id="+item.id
  92. })
  93. },
  94. del(item){
  95. that.currectData = item
  96. uni.showModal({
  97. title: '提示',
  98. content: '确定删除发布内容?',
  99. success (res) {
  100. if (res.confirm) {
  101. that.$u.debounce(that.delSubmit, 500)
  102. } else if (res.cancel) {
  103. console.log('用户点击取消')
  104. }
  105. }
  106. })
  107. },
  108. delSubmit() {
  109. uni.showLoading({
  110. title: '加载中',
  111. mask: true
  112. })
  113. this.$request.baseRequest('admin.tourism.productManagement', 'delete', {
  114. id: this.currectData.id
  115. }, failres => {
  116. uni.showToast({
  117. icon: "none",
  118. title: failres.errmsg,
  119. duration: 3000
  120. });
  121. uni.hideLoading()
  122. }).then(res => {
  123. uni.showToast({
  124. icon: "success",
  125. title: '删除成功!',
  126. duration: 2000
  127. });
  128. that.mescroll.resetUpScroll()
  129. })
  130. },
  131. toShopDetail(val){
  132. console.log(val)
  133. uni.navigateTo({
  134. url: "/pageA/food/detailMap?val="+JSON.stringify(val)
  135. })
  136. },
  137. delSearchVal() {
  138. this.searchVal = ''
  139. uni.removeStorageSync("search_val")
  140. that.mescroll.resetUpScroll()
  141. },
  142. search() {
  143. // if (this.userInfo.phone) {
  144. uni.navigateTo({
  145. url: "/pageA/find/search"
  146. })
  147. // } else {
  148. // this.showAuthorizePhone = true
  149. // }
  150. },
  151. async upCallback(page) {
  152. // if (uni.getStorageSync("userInfo").id) {
  153. uni.showLoading({
  154. title: '数据加载中'
  155. })
  156. var finddata = await that.getfindList(page)
  157. if (page.num == 1) that.findList = [], that.handleList = [];
  158. that.curPageLen = finddata.data.items.length;
  159. that.handleList = finddata.data.items
  160. that.totalPage = finddata.data.total;
  161. if (that.handleList.length > 0) {
  162. that.findList = that.handleList
  163. }
  164. uni.hideLoading()
  165. that.$nextTick(() => {
  166. that.mescroll.endBySize(that.curPageLen, that.totalPage)
  167. });
  168. // }
  169. },
  170. getfindList(page) {
  171. return new Promise((resolve, reject) => {
  172. that.$request.baseRequest('admin.tourism.productManagement', 'list', {
  173. page: page.num,
  174. limit: page.size,
  175. searchKeyWord: this.searchVal,
  176. myFlag:1,
  177. commonId:uni.getStorageSync("userInfo").id
  178. // classify: this.typeName
  179. }, failres => {
  180. uni.showToast({
  181. icon: "none",
  182. title: failres.errmsg,
  183. duration: 3000
  184. });
  185. }).then(res => {
  186. resolve(res)
  187. })
  188. })
  189. },
  190. }
  191. }
  192. </script>
  193. <style lang='scss' scoped>
  194. .content1 {
  195. position: fixed;
  196. top: 0;
  197. left: 0;
  198. padding: 20rpx;
  199. background-color: #fff;
  200. z-index: 99;
  201. width: 100vw;
  202. .search {
  203. // color: #9199af;
  204. // background: #f9d27d;
  205. border-radius: 50rpx;
  206. padding: 10rpx 0 10rpx 30rpx;
  207. box-sizing: border-box;
  208. margin-right: 20rpx;
  209. }
  210. .left {
  211. width: 80%;
  212. view {
  213. height: 40rpx;
  214. line-height: 40rpx;
  215. white-space: nowrap;
  216. overflow: scroll;
  217. position: relative;
  218. margin-left: 20rpx;
  219. color: #9199af;
  220. }
  221. }
  222. .right {
  223. // width:14%;
  224. margin-right: 20rpx
  225. }
  226. }
  227. .search-wrap {
  228. width: 100%;
  229. background: #f9f9f9;
  230. // border: 1px solid #f9d27d;
  231. border-radius: 50rpx;
  232. }
  233. .findItem {
  234. background: #fff;
  235. margin: 10rpx;
  236. border-radius: 20rpx;
  237. padding: 20rpx;
  238. font-size: 32rpx;
  239. .main-body {
  240. color: #E95700;
  241. background: #FDF2E5;
  242. font-size: 12px;
  243. padding: 6rpx 14rpx;
  244. box-sizing: border-box;
  245. border-radius: 10rpx;
  246. width:80rpx;
  247. }
  248. .left {
  249. margin-right: 20rpx;
  250. .cover {
  251. border-radius: 8rpx;
  252. }
  253. }
  254. .name {
  255. font-size: 30rpx;
  256. color: #333;
  257. margin-left: 10rpx;
  258. overflow-x: scroll;
  259. white-space: nowrap;
  260. width: 49vw;
  261. font-weight: 600;
  262. letter-spacing: 3rpx;
  263. }
  264. .description {
  265. color: #333;
  266. margin-top: 10rpx;
  267. width: 67vw;
  268. font-size: 28rpx;
  269. }
  270. .address {
  271. margin-top: 20rpx;
  272. width: 100%;
  273. font-size: 28rpx;
  274. color: #999;
  275. }
  276. }
  277. .applet-dianpu1 {
  278. font-size: 44rpx;
  279. color: #eaad1a;
  280. }
  281. .applet-dizhi {
  282. font-size: 38rpx;
  283. color: #393733;
  284. }
  285. </style>