用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

252 lines
6.0 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
a. 前端小程序部分: ⅰ. 授权登录成功之后,后面点击头像进行个人资料编辑的时候,原来的历史个人资料需要展示在表单上:头像,昵称,手机号码 (已处理) ⅱ. 个人中心手机号码下方,如果做了企业认证则显示企业公司名称 (已处理 展示认证状态) ⅲ. 对接流水钱包的数据,让数据渲染正确,能正常提交以及审核提现,提现需要增加一个用户真实姓名的字段,提现需要一个到账状态,提现功能区看酒布代码或者是真世界代码,确保功能的完整性 提现新增字段 realName (已处理) ⅳ. 我的服务这些设置的小图标需要换成正常的,如果没画的区阿里巴巴矢量图标库找一个合适的(已处理) ⅴ. 企业入驻:公司地址需要吊起地图,记录经纬度,另外审核通过状态的数据,不能再进行修改 (已处理) longitude:"",latitude:"", ⅵ. 个人入住:审核通过状态的数据,不能再进行修改(已处理) ⅶ. 我的简历:审核通过状态的数据,不能再进行修改(没有status 字段) ⅷ. 发布订单:出行方式字段对接一下select_go字段,结算方式说明前端要跟后台数据说明同步 (已处理)selectGo ⅸ. 分类管理:点击分类管理可以只查询当前一级分类数据,另外名称搜索功能需要增加一下 (已处理) X. 工作详情里面的公司地址要能点击到地图中去,另外右边增加一个拨打电话的按钮 (这个是微信组件 不能添加) Xⅰ. 列表数据处理一下下拉刷新数据,每次数据没有更新,没有下啦刷新处理 (已处理)
5 months ago
a. 前端小程序部分: ⅰ. 授权登录成功之后,后面点击头像进行个人资料编辑的时候,原来的历史个人资料需要展示在表单上:头像,昵称,手机号码 (已处理) ⅱ. 个人中心手机号码下方,如果做了企业认证则显示企业公司名称 (已处理 展示认证状态) ⅲ. 对接流水钱包的数据,让数据渲染正确,能正常提交以及审核提现,提现需要增加一个用户真实姓名的字段,提现需要一个到账状态,提现功能区看酒布代码或者是真世界代码,确保功能的完整性 提现新增字段 realName (已处理) ⅳ. 我的服务这些设置的小图标需要换成正常的,如果没画的区阿里巴巴矢量图标库找一个合适的(已处理) ⅴ. 企业入驻:公司地址需要吊起地图,记录经纬度,另外审核通过状态的数据,不能再进行修改 (已处理) longitude:"",latitude:"", ⅵ. 个人入住:审核通过状态的数据,不能再进行修改(已处理) ⅶ. 我的简历:审核通过状态的数据,不能再进行修改(没有status 字段) ⅷ. 发布订单:出行方式字段对接一下select_go字段,结算方式说明前端要跟后台数据说明同步 (已处理)selectGo ⅸ. 分类管理:点击分类管理可以只查询当前一级分类数据,另外名称搜索功能需要增加一下 (已处理) X. 工作详情里面的公司地址要能点击到地图中去,另外右边增加一个拨打电话的按钮 (这个是微信组件 不能添加) Xⅰ. 列表数据处理一下下拉刷新数据,每次数据没有更新,没有下啦刷新处理 (已处理)
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <view class="se-m-10">
  3. <u-sticky>
  4. <view class="se-px-20 se-pt-10 se-zi-s se-bgc-white">
  5. <u-search height="40" placeholder="搜索" :showAction="true" v-model="keyword" @search="onSearch()"
  6. @clickIcon="onSearch()"
  7. @clear="onSearch"
  8. @custom="onSearch()"></u-search>
  9. </view>
  10. <u-tabs class="se-bgc-white se-pb-20" :current="current" lineWidth="30" lineColor="#FF7A31" :activeStyle="{
  11. color: '#303133',
  12. fontWeight: 'bold',
  13. transform: 'scale(1.05)'
  14. }" :inactiveStyle="{
  15. color: '#606266',
  16. transform: 'scale(1)'
  17. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" :list="navList" @click="navClick($event)">
  18. </u-tabs>
  19. </u-sticky>
  20. <!-- 使用列表组件渲染数据 -->
  21. <template v-if="current==0">
  22. <enterprise :rolelist="rlist"></enterprise>
  23. </template>
  24. <template v-if="current==1">
  25. <master :taskList="tList"></master>
  26. </template>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. bannerList,
  32. taskList,
  33. rolelist,
  34. industryList,
  35. querySeekList,
  36. getSysText
  37. } from "@/common/api.js"
  38. import master from "@/components/list/master.vue"
  39. import enterprise from "@/components/list/enterprise.vue"
  40. export default {
  41. components: {
  42. master,
  43. enterprise
  44. },
  45. data() {
  46. return {
  47. tpageNo: 1,
  48. tpageSize: 20,
  49. tList: [],
  50. rpageNo: 1,
  51. rpageSize: 20,
  52. rlist: [],
  53. id: null,
  54. keyword: "",
  55. current: 0,
  56. navList: [{
  57. name: '求职大厅',
  58. },
  59. {
  60. name: '招聘大厅',
  61. }
  62. ],
  63. }
  64. },
  65. onLoad(options) {
  66. this.id = options.id
  67. if (options.title) {
  68. uni.setNavigationBarTitle({
  69. title: options.title
  70. })
  71. }
  72. // this.onTaskList()
  73. this.onRolelist()
  74. },
  75. onReachBottom() {
  76. let that = this
  77. if (that.current == 0) {
  78. that.rpageNo = that.rpageNo + 1
  79. that.onRolelist()
  80. } else if (that.current == 1) {
  81. that.tpageNo = that.tpageNo + 1
  82. this.onTaskList()
  83. }
  84. },
  85. onPullDownRefresh() {
  86. let that = this
  87. if (that.current == 0) {
  88. that.rpageNo = 1
  89. that.rlist = []
  90. that.onRolelist()
  91. } else if (that.current == 1) {
  92. that.tpageNo = 1
  93. that.tList = []
  94. this.onTaskList()
  95. }
  96. },
  97. filters: {
  98. formatTime(time) {
  99. const timestamp = new Date(time).getTime();
  100. const currentTime = new Date().getTime();
  101. console.info("currentTime", currentTime)
  102. const diff = (currentTime - timestamp) / 1000; // 时间差,单位:秒
  103. // 计算月差,判断是否超过一个月
  104. const oneMonthInSeconds = 30 * 24 * 60 * 60;
  105. if (diff > oneMonthInSeconds) {
  106. let date = new Date(timestamp);
  107. let year = date.getFullYear();
  108. let month = date.getMonth() + 1;
  109. let day = date.getDate();
  110. if (month < 10) month = "0" + month;
  111. if (day < 10) day = "0" + day;
  112. return `${year}-${month}-${day}`;
  113. } else {
  114. // 计算秒、分钟、小时的差值
  115. if (diff < 60) {
  116. return `${Math.floor(diff)}秒钟前`;
  117. } else if (diff < 60 * 60) {
  118. return `${Math.floor(diff / 60)}分钟前`;
  119. } else if (diff < 60 * 60 * 24) {
  120. return `${Math.floor(diff / 60 / 60)}小时前`;
  121. } else {
  122. // 显示天数
  123. return `${Math.floor(diff / 60 / 60 / 24)}天前`;
  124. }
  125. }
  126. },
  127. formDate(date) {
  128. return dayjs(date).format("YYYY-MM-DD").fromNow();
  129. },
  130. getDistance(lat1, lng1) {
  131. let lng2 = uni.getStorageSync("longitude")
  132. let lat2 = uni.getStorageSync("latitude")
  133. if (!lng2 && !lat2) {
  134. return "请授权"
  135. }
  136. const R = 6371; // 地球半径,单位:km
  137. const radLat1 = (lat1 * Math.PI) / 180;
  138. const radLat2 = (lat2 * Math.PI) / 180;
  139. const deltaLat = radLat2 - radLat1;
  140. const deltaLng = ((lng2 - lng1) * Math.PI) / 180;
  141. const a =
  142. Math.sin(deltaLat / 2) * Math.sin(deltaLat / 2) +
  143. Math.cos(radLat1) *
  144. Math.cos(radLat2) *
  145. Math.sin(deltaLng / 2) *
  146. Math.sin(deltaLng / 2);
  147. const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
  148. return (R * c).toFixed(2); // 返回保留两位小数的公里数
  149. }
  150. },
  151. methods: {
  152. navClick(event) {
  153. this.current = event.index
  154. this.keyword = ""
  155. if (event.index == 0) {
  156. this.rpageNo = 1
  157. this.onRolelist()
  158. } else if (event.index == 1) {
  159. this.tpageNo = 1
  160. this.onTaskList()
  161. }
  162. },
  163. onSearch() {
  164. let that = this
  165. if (that.current == 0) {
  166. that.rpageNo = 1
  167. that.onRolelist()
  168. } else if (that.current == 1) {
  169. that.tpageNo = 1
  170. this.onTaskList()
  171. }
  172. },
  173. onRolelist() {
  174. querySeekList({
  175. pageNo: this.rpageNo,
  176. pageSize: this.rpageSize,
  177. address: this.keyword,
  178. categoryOne: this.id,
  179. }).then(response => {
  180. console.info("response", response)
  181. if (this.rpageNo == 1) {
  182. this.rlist = response.result.records
  183. } else {
  184. this.rlist = this.rlist.concat(response.result.records)
  185. }
  186. }).catch(error => {
  187. })
  188. },
  189. onTaskList() {
  190. taskList({
  191. latitude: uni.getStorageSync("latitude"),
  192. longitude: uni.getStorageSync("longitude"),
  193. pageNo: this.tpageNo,
  194. title: this.keyword,
  195. categoryOne: this.id,
  196. pageSize: this.tpageSize
  197. }).then(response => {
  198. if (this.tpageNo == 1) {
  199. this.tList = response.result.records
  200. } else {
  201. this.tList = this.tList.concat(response.result.records)
  202. }
  203. }).catch(error => {
  204. })
  205. },
  206. onTaskDetail(event) {
  207. console.info(event)
  208. uni.navigateTo({
  209. url: "/pages_subpack/work-detail/index?id=" + event.id
  210. })
  211. },
  212. onRoleDetail(event) {
  213. console.info("event", event)
  214. uni.navigateTo({
  215. url: "/pages_subpack/master-detail/index?id=" + event.id
  216. })
  217. },
  218. onCustomerService(phome) {
  219. let that = this
  220. // let obj = that.$utils.getkeyContent('phone')
  221. if (uni.canIUse('makePhoneCall')) {
  222. uni.makePhoneCall({
  223. phoneNumber: String(phome),
  224. success: function() {
  225. console.log('拨打电话成功');
  226. },
  227. fail: function() {
  228. console.log('拨打电话失败');
  229. }
  230. });
  231. } else {
  232. console.log('你的设备不支持拨打电话功能');
  233. }
  234. },
  235. }
  236. }
  237. </script>
  238. <style>
  239. </style>