list.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <view class="content">
  3. <view>
  4. <view class="active-title-box">
  5. <view class="header-title">{{activeDesc.name}}</view>
  6. <view style="color: gray;">{{activeDesc.start_time}}</view>
  7. </view>
  8. <view class="active-box" v-for="(item,index) in activiList" :key="index" style="flex-direction: column;" :class="index===activiList.length-1?'marginB40':''">
  9. <view class="active-content-box">
  10. <view class="active-content">
  11. <view class="active-title">{{item.content}}</view>
  12. </view>
  13. </view>
  14. <view class="active-header">
  15. <!-- <view class="active-type">
  16. <text style="margin: 0 auto;">头像</text>
  17. </view> -->
  18. <view class="active-content-box">
  19. <view class="active-content margin-top-3">
  20. <view class="active-name">{{item.author}}</view>
  21. <!-- <view class="active-date">{{item.addtime}}</view> -->
  22. </view>
  23. <view class="active-content">
  24. <view class="active-date">{{item.addtime}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="active-content-box-img margin-top-3">
  29. <view v-for="(img,indexImg) in item.pic_list" :key="indexImg" class="marginR5">
  30. <image :src="img.pic_url_resize" mode="aspectFill" @click="showLarge(item.pic_list,indexImg)"></image>
  31. </view>
  32. </view>
  33. <view class="margin-top-3" style="color: #007AFF;" @click="tonewurl(item.web_url)">
  34. {{item.web_url}}
  35. </view>
  36. <view class="edit-icon-box">
  37. <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id)"></image>
  38. <image src="/static/del-icon.png" mode="aspectFit" v-if="item.del_auth" @click="delProcess(item.id)"></image>
  39. </view>
  40. </view>
  41. <button class="footer-box-record" @click="goRecord()">上传记录</button>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import md5 from "@/common/md5.js";
  47. export default {
  48. components: {
  49. },
  50. data() {
  51. return {
  52. isAuth:getApp().globalData.globalAuth,
  53. userHeadImg: getApp().globalData.user_headUrl,
  54. userNickName:getApp().globalData.user_name,
  55. globalUrl:getApp().globalData.shareUrl,
  56. activeId:'',
  57. branchId:'',
  58. recordId:'',
  59. activeDesc:{},
  60. activiList:[]
  61. };
  62. },
  63. onLoad(option) {
  64. this.recordId = option.id;
  65. this.readDesc(this.recordId)
  66. //this.readActive(this.recordId)
  67. },
  68. onShow() {
  69. this.readActive(this.recordId)
  70. },
  71. methods: {
  72. goEditPage(id){
  73. uni.navigateTo({
  74. url:'./record?id='+ id + '&bId=' + this.branchId + '&aId=' + this.activeId + '&types=edit'
  75. })
  76. },
  77. showLarge(urlList,index) {
  78. let imgList = urlList,imgArr = [];
  79. imgList.forEach((item,index)=>{
  80. imgArr.push(item.pic_url)
  81. })
  82. uni.previewImage({
  83. urls:imgArr,
  84. current:imgArr[index],
  85. longPressActions: {
  86. itemList: ["发送给朋友", "保存图片"],
  87. success: function (data) {},
  88. fail: function (err) {
  89. console.log(err.errMsg);
  90. },
  91. },
  92. });
  93. },
  94. delProcessRequeset(delId){
  95. let md5Sign = md5(
  96. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  97. "&secret=" + getApp().globalData.secret
  98. );
  99. let url = getApp().globalData.shareUrl +"api/api.php" +
  100. "?method=activity&action=process_del&timestamp=" +
  101. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  102. uni.request({
  103. url: url,
  104. method: "POST",
  105. header: {
  106. "content-type": "application/x-www-form-urlencoded",
  107. },
  108. data: {
  109. openid: getApp().globalData.open_id,
  110. id:delId
  111. },
  112. success: (res) => {
  113. if (res.data.code === 200) {
  114. uni.showToast({
  115. title: "删除成功",
  116. icon: "none",
  117. duration: 2500,
  118. success:()=>{
  119. this.readActive(this.activeId)
  120. }
  121. });
  122. }
  123. },
  124. fail: () => {
  125. console.log("连接失败");
  126. },
  127. });
  128. },
  129. delProcess(id){
  130. let that = this;
  131. uni.showModal({
  132. title: "确定删除此记录吗?",
  133. success(res) {
  134. if (res.confirm) {
  135. that.delProcessRequeset(id);
  136. } else if (res.cancel) {
  137. console.log("用户点击取消");
  138. }
  139. },
  140. });
  141. },
  142. readDesc(id){
  143. let md5Sign = md5(
  144. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  145. "&secret=" + getApp().globalData.secret
  146. );
  147. let url = getApp().globalData.shareUrl +"api/api.php" +
  148. "?method=activity&action=info_by_id&timestamp=" +
  149. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  150. uni.request({
  151. url: url,
  152. method: "POST",
  153. header: {
  154. "content-type": "application/x-www-form-urlencoded",
  155. },
  156. data: {
  157. openid:getApp().globalData.open_id,
  158. id:id
  159. },
  160. success: (res) => {
  161. if (res.data.code === 200) {
  162. this.activeDesc = res.data.data;
  163. this.branchId = res.data.data.branch_id;
  164. this.activeId = res.data.data.id;
  165. }
  166. },
  167. fail: () => {
  168. console.log("连接失败");
  169. },
  170. });
  171. },
  172. readActive(id){
  173. let md5Sign = md5(
  174. "method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
  175. "&secret=" + getApp().globalData.secret
  176. );
  177. let url = getApp().globalData.shareUrl +"api/api.php" +
  178. "?method=activity&action=process_list&timestamp=" +
  179. getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
  180. uni.request({
  181. url: url,
  182. method: "POST",
  183. header: {
  184. "content-type": "application/x-www-form-urlencoded",
  185. },
  186. data: {
  187. openid:getApp().globalData.open_id,
  188. activity_id:id
  189. },
  190. success: (res) => {
  191. if (res.data.code === 200) {
  192. let listArr = res.data.data.list;
  193. listArr.forEach((item)=>{
  194. item.pic_list.forEach((child)=>{
  195. child.pic_url = this.globalUrl + child.pic_url;
  196. child.pic_url_resize = this.globalUrl + child.pic_url_resize;
  197. })
  198. })
  199. this.activiList = listArr;
  200. }
  201. },
  202. fail: () => {
  203. console.log("连接失败");
  204. },
  205. });
  206. },
  207. tonewurl(urls) {
  208. console.log(urls)
  209. // 判断链接是否为空
  210. if (!urls) {
  211. return false;
  212. }
  213. // 判断链接是否为https
  214. // let notS = urls.split(':')[0];
  215. // let a = notS.indexOf('s') > -1;
  216. // if (a == false) {
  217. // return false;
  218. // }
  219. uni.navigateTo({
  220. url:'/pages/index/webview/web-view?url=' + urls
  221. });
  222. },
  223. goRecord(){
  224. uni.navigateTo({
  225. url:'./record?bId=' + this.branchId + '&aId=' + this.activeId + '&types=add'
  226. })
  227. }
  228. },
  229. };
  230. </script>
  231. <style lang="scss" scoped>
  232. .content {
  233. display: flex;
  234. flex-direction: column;
  235. .self-inf {
  236. // border-radius: 0rpx 0rpx 100% 100%;
  237. .img-name-box {
  238. height: 150rpx;
  239. margin-top: 20rpx;
  240. margin-bottom: 20rpx;
  241. display: flex;
  242. align-items: center;
  243. width: 85%;
  244. .auth-btn {
  245. margin-left: 30rpx;
  246. margin-top: 20rpx;
  247. font-size: 28rpx;
  248. background-color: #02a7f0;
  249. color: #fff;
  250. }
  251. .heade-img {
  252. z-index: 1;
  253. width: 100rpx;
  254. height: 100rpx;
  255. border-radius: 50%;
  256. // margin-left: 80rpx;
  257. }
  258. }
  259. .nickname {
  260. font-weight: 600;
  261. font-size: 28rpx;
  262. margin-left: 30rpx;
  263. margin-top: 20rpx;
  264. color: #555;
  265. letter-spacing: 1rpx;
  266. }
  267. }
  268. }
  269. .org-info-box {
  270. display: flex;
  271. justify-content: space-evenly;
  272. height: 80rpx;
  273. align-items: center;
  274. width: 100%;
  275. border-top: 1px solid #d4d4d4;
  276. color: #555;
  277. font-size: 28rpx;
  278. background: #fff;
  279. }
  280. .org-line {
  281. width: 1px;
  282. height: 82rpx;
  283. background: #d4d4d4;
  284. }
  285. .header-title {
  286. margin-top: 3%;
  287. margin-bottom: 1%;
  288. font-size: 32rpx;
  289. font-weight: bold
  290. }
  291. .active-title-box {
  292. padding-left: 3%;
  293. font-size: 26rpx;
  294. height: 100rpx;
  295. border-bottom: 4px solid #eeeeee;
  296. .time-select-box {
  297. width: 32%;
  298. margin-left: 5%;
  299. }
  300. picker {
  301. width: 25%;
  302. border: 1px solid #d7d7d7;
  303. height: 60rpx;
  304. line-height: 60rpx;
  305. border-radius: 10rpx;
  306. margin-left: 20rpx;
  307. padding: 0 10rpx;
  308. position: relative;
  309. image {
  310. width: 20rpx;
  311. height: 20rpx;
  312. position: absolute;
  313. top: 11px;
  314. right: 5px;
  315. }
  316. }
  317. button {
  318. width: 24%;
  319. font-size: 25rpx;
  320. background: #4988fd;
  321. color: #fff;
  322. margin-left: 25rpx;
  323. }
  324. }
  325. .margin-top-3 {
  326. margin-top: 3%;
  327. }
  328. .active-box {
  329. display: flex;
  330. position: relative;
  331. font-size: 28rpx;
  332. padding: 20rpx;
  333. border-bottom: 1px solid #d7d7d7;
  334. .active-header {
  335. display: flex;
  336. width: 100%;
  337. }
  338. .active-type {
  339. width: 100rpx;
  340. height: 100rpx;
  341. border-radius: 50%;
  342. background-color: #ccc;
  343. text-align: center;
  344. display: flex;
  345. align-items: center;
  346. font-size: 26rpx;
  347. color: #fff;
  348. }
  349. .active-content-box{
  350. display: flex;
  351. flex-direction: column;
  352. // margin-left: 20rpx;
  353. }
  354. .active-content-box-img {
  355. display: flex;
  356. justify-content: flex-start;
  357. image {
  358. width: 230rpx;
  359. height: 160rpx;
  360. }
  361. }
  362. .active-content {
  363. display: flex;
  364. align-items: center;
  365. // height: 45rpx;
  366. font-size: 26rpx;
  367. .active-title {
  368. font-size: 28rpx;
  369. margin-right: 10rpx;
  370. font-weight: bold;
  371. }
  372. .active-name {
  373. font-size: 26rpx;
  374. margin-right: 10rpx;
  375. }
  376. .active-date {
  377. color: #ccc;
  378. }
  379. }
  380. .edit-icon-box {
  381. position: absolute;
  382. right: 10px;
  383. top: 10px;
  384. image {
  385. width: 35rpx;
  386. height: 35rpx;
  387. margin-right: 10rpx;
  388. }
  389. }
  390. .bg-yellow {
  391. background-color: #ffdd40;
  392. }
  393. .bg-red {
  394. background-color: #ec808d;
  395. }
  396. .bg-blue {
  397. background-color: #81d3f8;
  398. }
  399. }
  400. .marginB40 {
  401. margin-bottom: 80rpx;
  402. }
  403. .marginR5{
  404. margin-right: 10rpx;
  405. }
  406. .footer-box-record{
  407. position: fixed;
  408. bottom: 0;
  409. background-color:#f59a23;
  410. width: 100%;
  411. border-radius: 0;
  412. color: #fff;
  413. font-size: 32rpx;
  414. }
  415. </style>